Making an argument parser. I want to split a string into an array where the delimiter is ", "
except when preceded by "|"
. That means string
"foo, ba|, r, arg"
should result in
`["foo", "ba|, r", "arg"]`
I'm trying to use this regex: (?<!\|),
which works in http://regexhero.net/tester/ but when I try
args.split(/(?<!\|), /)
in ruby, I get an error: undefined (?...) sequence: /(?<!\|), /