Is there any open source solution, or a generic regex for parsing name-value (key-value) pairs out of a random String, in Java, with the (optional) delimiters stripped out?
From a Regular expression for parsing name value pairs, one such regex could be
"((?:\"[^\"]*\"|[^=,])*)=((?:\"[^\"]*\"|[^=,])*)"
However, the above (and its variations on the aforementioned question), although working as expected, return the delimiters along with the value.
For instance, a pair like key="value"
will produce {key, "value"} instead of {key, value}.
The latter form of output would be nicer, since it avoids string post-processing to remove the enclosing delimiters (quotes in this case).