I'm trying to wrap my mind around regex for the first time.
For the string
I want you to MATCH THIS, you bastard regex, but also MATCH X THIS and yeah,
MATCH X X X THIS too.
Basically, a starting pattern, an end pattern and an arbitrary number of a pattern inbetween.
So I'd like a myregex.exec string
to successively return
["MATCH", "THIS"]
["MATCH", "X", "THIS"]
["MATCH", "X", "X", "X", "THIS"]
I've tried variations of this
/(MATCH)\s+(X)?\s+(THIS)/
but no cigar...