/("[^"]+|-)/
You can also use non-capturing parentheses ((?:...)) with expressions of the form:
/((?:"[^"]+)|(?:-))/.
You also might want to add a close double quote to your regular expression, so you don't match incorrectly on "A string" not a string "a string", a la
/("[^"]+"|-)/
See perlretut for more information.
In reply to Re: Regex: Matching quoted text
by kennethk
in thread Regex: Matching quoted text
by cmm7825
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |