I am trying to split a string on white spaces only (\s
), but that are not between a "quoted" section.
I am matching all text in between these quoted sections in the following manner:
(['"`]).*?\1
However, when I try to add this as a negative lookahead, to only split on white spaces outside of those quotes, I can't get it to work:
\s(?!(['"`]).*?\1)
How can I only split on the white spaces that are not in "quotes"?