regular expression to find a substring inside a string


I have 2 arrays.

I am doing a nested loop, then I should search if the 1st array element contains the 2nd array element.
Suppose, the 1st array element is :: “we can not find a solution for this”
the 2nd array element is :: “find a solution”
I should search if “find a solution” is present in “we can not find a solution for this”

To achieve this, I am using a sequence and I am writing the label like:

%errorDetailDoc/Events/ErrorDump% = /%ErrorHandlingProperties/properties/ErrorCategory/NetworkException/NetworkError%/

But this is not working.
Can somebody please help me on this.



Loop over both the array elements first and
Take branch step, and set evaluate labels to true
then, move the sequence ( your code) inside branch as a child sequence.


Hi Jyoti,

There are some problems in what you say.

  1. You say that you want to check for containment and yet you test the equality

  2. %errorDetailDoc/Events/ErrorDump% = /%ErrorHandlingProperties/properties/ErrorCategory/NetworkException/NetworkError%/ is not correct

the / characters should be inside the %%

My suggestion is:

  1. to check the WMPublic services to see if there is a service that checks the containment of a string within another string
  2. if no such service exists you can make your own java service that can easily test the containment (

Hope this helped,
Vlad Turian

Hi Jyoti,

Additiionally you can check out the PSUtilities Package available from tech community downloads section.


If you don’t want to use java service, you can just try:
give the first and 2nd string as the parameters.

Hi Jyoti,

You can try below Reg Exp statement as it is used for searching a document with specific string .


But in this case you cannot use this in side label property of any service as label works on Boolean functions.

For more details in regular expression you can refer the below documents on page no 1120.

better use pub.string:indexOf built in service or any java Service.

Ashish Kumar

Hi All,

I wrote a java service to check if one string is contained inside another string and it worked. :slight_smile:
Thanks a lot everyone for your help.