How make regex pattern optional?

Hi I am new to regex in uipath, I have this code: (?<=Module Name:\s)([A-Z](#|++|-)?\s[A-Z]\s[A-Z])\s[A-Z]+(/)[A-Z]+\s[A-Z]+
How do I make ([A-Z]
(#|++|-)?\s[A-Z]\s[A-Z]) optional but will be run if there is this pattern ?

you can go for OR operation

@aditya.prakash do you have an example with reference to my regex above?

((^|, )(option1|option2|option3))+$

all options you can keep inside


@aditya.prakash what does (^|,) mean and whats the + $ for?

(^|,) => if any
$ stands for ends with


@aditya.prakash oh okay thank you I will try first might need some help still maybe!

1 Like

Ok @Jovian_Low

you can make it working on online Regex editors, Happy Automation :wink: