Regex operator question

Hey everyone,

I have condition which is:
System.Text.RegularExpressions.Regex.IsMatch(description.ToString,“mistake|error”,System.Text.RegularExpressions.RegexOptions.IgnoreCase)

what it does is, gives true if description variable contains mistake or error.

What I want to is modifity it to: if description has “mistake” and “error” inside it the output should be true, so:
“I bought a phone, there was a mistake with it gave me an error after executing the application”
I want this to be output as true.

How can I make this work?

@berkaykor
regex.isMatch will return true when pattern is found
in your case if mistake or error is found in the string (Case insensitive) it will return true

About second question. Here regex101 is helping much:

As the | is executing as Or and checks not that all patterns are matching, we can do following:

RegEx_AllPatternsDoMatch.xaml (4.8 KB)

Have also a look on this:

3 Likes

Thank you very much Peter. You are everywhere, I appreciate it

1 Like

Rumour has it @ppr is actually a bot… :stuck_out_tongue_winking_eye:

1 Like

the first RPA bot ever made. :smiley:

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