that should put the match in $1, regardless which alternation matched./(?|"([^"]+)"|(-))/
If you are using a pre-5.10 perl, consider this a good reason to upgrade.
In reply to Re: Regex: Matching quoted text
by JavaFan
in thread Regex: Matching quoted text
by cmm7825
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |