in reply to Regex: Matching quoted text
/("[^"]+|-)/
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.
|
|---|