Detect a substring with RegEx

Hello, everyone,

is there a possibility to recognize a text from a string with regEx and save it into another variable?

The activity IsMatch unfortunately only returns a Boolean value.

1 Like

You can use this activity:

2 Likes

The output variable is of type IEnumerable. The following is output with Variable.ToString

System.Linq.Enumerable+d__97`1 [System.Text.RegularExpressions.Match]

It does not work with a loop either. How do you do it right?

It works with loop, but the loop variable type should be Match, and to get the matched value, use loopVaraible.Value

3 Likes

Hi,

After matching the expression use this in left side of assign activity and store in a string variable
“iEnumerable.Cast(Of Object).First.ToString”

Let us know if this helps.
Regards,
pavan H

1 Like

Would you please describe it better?

The left side of the assign activity is for the variable in which the value is stored…

Hi,
So when you use a matches activity, you will get results in IEnumerable format, so inorder to use it as a string you use the above code in assign activity left side and assign it to a string variable which will be in the right side of assign activity(user defined string)

let me know if you can go through this.
Regards,
Pavan H

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.