java - Parsing key value pairs using regular expression -
i've scenario have capture key value pairs string key cannot contain spaces. following constraints apply values:
- they can contain spaces when delimited single or double quotes.
- they can contain single quotes when delimited double quotes.
- they can contain double quotes when delimited single quotes.
- key value pairs separated using spaces/tabs.
single string contains key/value pairs extract (using / string delimiters simplicity):
/abc="hello how you" xyz="i'm good. how you?" pqr='using " double quotes'/
i parse above string , extract name/value pairs:
abc="hello how you"
xyz="i'm good. how you?"
pqr='using " double quotes'
Comments
Post a Comment