undefined group option when using branch reset group regex in Ruby

34 views Asked by At

I'm working with Ruby and I have a regex to match a pattern:

REGEX = /(?|"([^"]*)"|'([^']*)'|(.*))/ (https://regex101.com/r/t2jXuu/1)

It works very well as I can test with regex101, but when I run the Ruby code, I face:

undefined group option: /(?|"([^"]*)"|'([^']*)'|(.*))/ (SyntaxError)

What does it mean and how to fix it?

Thanks

0

There are 0 answers