How to get each Second result from regex

Dear All,

Help me to get each Second result from regex

Thanks

Hi @SURESH_P

Can you elaborate more … what do you mean by every second?

Cheers

Hey @SURESH_P

Try this below to get the second result.

Assign Left:

INSERTxNEWxSTRINGxVARIABLE

Assign Right: System.Text.RegularExpressions.Regex.Matches(INSERTxYOURxRAWxText,“INSERTxREGEXxPATTERN”)(1).ToString

Note: 1 = Second result

Cheers

Steve

First change IEnumerable to string variable.
i)String.join(“,”,varname).split(1)=>U get 2nd item
Note: “,”=>It seperate all the matching value by comma so we can get value using split activity

1 Like

Hi @SURESH_P

If you need to take the second match Result Then try with this below expression

System.Text.RegularExpressions.Regex.Matches(YourString,"(?<=Test\s-\s)\d.*")(1).ToString

image

Regards
Gokul

1 Like

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