If I have the following scenario for this command line application I'm building...
update DIFFICULTY=1 DESCRIPTION="some long run on description"
I want to capture DIFFICULTY=1
and I want to capture DESCRIPTION="some long run on description"
as two separate groups, and if I eventually add on more to the api, potentially another DESCRIPTION
field, how would I go about doing so using regex. Casing doesn't matter so much on the left side.
I've got this so far, but it doesn't catch the whole quoted text of description, nor do I think it'd separate potential future additional description fields.
/([A-Z])([\w="])+/g
I'm using .NET cores regular expression library to figure this out as an FYI, in case there are any gotchas in js regular expressions.