With a key value pair string that is separated by space character (just one I believe will ever happen) but also allows spaces and other white space (e.g. newlines, tabs) in the value, e.g.
a=1 b=cat c=1 and 2 d=3
becomes:
- a=1
- b=cat
- c=1 and 2
- d=3
i.e. I want to extract all the pairs as groups.
I cannot figure out the regex. My sample doesn't include newline but that could also happen
I've tried the basics like:
(.+?=.+?)
\s?([^\s]+)
but these fail with space and newlines. I'm coding it also so can tidy up any leading/trailing characters where needed, I just rather do it in regex than scan one character at a time.