How to do conditional "or" in regex?

Hi @Lynx

The pipe symbol “|” represents Or in Regex.

Take a look at this Regex Pattern I have created for you.
image

I have used an achor on the text “OP. GRAVADA” and then inserted some brackets which will find either “S/” or “$” (note that “$” must be escaped “\$” like this to mean it literally instead of the end of a line).

Just be aware that Regex101.com is great for learning and for ‘basic’ Regex Patterns but I strongly recommend using RegexStorm as it is 100% compatible with UiPath (as far as I know :slight_smile:). You can Regex101.com but always check your pattern in RegexStorm before inserting into UiPath.

Cheers

Steve

1 Like