I want to split a command line like string in single string parameters. How look the regular expression for it. The problem are that the parameters can be quoted. For exampl
Regex: /[\/-]?((\w+)(?:[=:]("[^"]+"|[^\s"]+))?)(?:\s+|$)/g
Sample: /P1="Long value" /P2=3 /P3=short PwithoutSwitch1=any PwithoutSwitch2
Such regex can parses the parameters list that built by rules:
/ or -).= or :.This regex has three groups:
For sample above:
/P1="Long value"
P1="Long value",P1,"Long value"./P2=3
P2=3,P2,3./P3=short
P3=short,P3,short.PwithoutSwitch1=any
PwithoutSwitch1=any,PwithoutSwitch1,any.PwithoutSwitch2
PwithoutSwitch2,PwithoutSwitch2,