Regex Result is not getting captured as boolean

Hi Team,

I am using regex expression for validation. after that i am using If condition so that i can do the action accordingly but i am not able to catch the regex result in my condition.

regex Result Var: validEmail
i printed validEmail.toString but for both cases it is getting printed as
“System.Linq.Enumerable+d__97`1[System.Text.RegularExpressions.Match]”

i tried a lot but not able to get please help me out.

Thanks & Regards
Sandeep Kumar

@Sandeep_Kumar3 - Did you used IsMatch activity ??

If not, please use IsMatch activity which Results in boolean output. And then you can use that in If condition.

Sample

You can use regex as boolean like this:

bool_Exist = System.Text.RegularExpressions.Regex.isMatch(str_Var, “Pattern”)

@Sandeep_Kumar3 - Another option would be…

If Regex.Match didnt recognize, you have to import System.text.Regular.expressions as I showed above…

Thanks its working, actually I was using match activity

1 Like