I'm trying to parse some strings where the values could be given like:
stuff "Something" stuff
or
stuff 'something' stuff
I solved this bit easily with:
(?<quote>"|')(?<quoted_value>[^'"]+)\k<quote>
However I've come across a problem where I have:
stuff "Today's Top 10" stuff
And I thought I could use the captured quote as the argument for the quoted_value
pattern like so:
(?<quote>"|')(?<quoted_value>[^\k<quote>]+)\k<quote>
But I get
Unrecognized escape sequence \k
How can I use the first quote
capture value as a condition to capture everything until that value is found again?