Regex until first occurrence of a characters

Hi, you need to add a ? next to the + so it is non-greedy.

(?<=;)WO.+?(?=(\)(\s|)\;))
Maybe something like this, or without the whitespace:
(?<=;)WO.+?(?=(\)\;))

But, you can adjust it for your needs.

Regards.

4 Likes