I’m trying to get a regex that matches: (It should not match any other string)
Word1 or Word2 or Word3 or Wordn
Capturing the words between before or after an “or”
1: Word1
2: Word2
3: Word3
n: Wordn
I’ve tried modifying a csv regex:
(?:^|,)(\"(?:[^\"]+|\"\")*\"|[^,]*)
to
(?:^|(?:or)((?:[^(?:or)]+)*|[^(?:or)]*)
But that does not give me what I want.
I’m sure I’m missing something, but I’ve been banging my head for hours.
How about:
The above will output: