I'm writing an interpreter and I'd like to capture the function arguments. Given something in quotes, like ('one, two',3,"four")
I'd like to use regex (if its possible) to extract each of the elements: 'one, two'
, and 3
, and "four"
despite being single- or double- quoted, or no-quoted. I'd also like it to recognize to skip commas within quotes (so 'one, two'
is interpreted as a single parameter). How is this possible?
I've tried some things and had no luck and haven't found any question like this yet that can handle quotes in the parameter list. I'd be grateful for any help.