I’m writing a command line interpreter but i’m blank on this type of input:
command -text "hello this is "some text" with "quotes inside"" -other "another thing""" -another " -another "text"
I need to escape the quotes and then input the string into my parser.
What i thought:
/".+"/ but it takes everything from the first quote.
Do you have any insights?
EDIT:
What i want:
input: command -text "hello this is "some text" with "quotes inside"" -other "another thing""" -another " -another "text"
output: command -text "hello this is \"some text\" with \"quotes inside\"" -other "another thing\"\"" -another " -another \"text"
Well, I have a VERY ugly solution… It handles everything but dashes within strings.
Hope your eyes don’t get hurt…
Explaining it a little…