What you have is fine, except for an error in $match. You forgot to escape the right paren. You should use single quotes so that complicated quoting issues don't arise, also.
Added: The qr operator, as suggested by Samy_rio++, has a lot to recommend it for this.
After Compline,
Zaxo
In reply to Re: Regex from string
by Zaxo
in thread Regex from string
by rimmern
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |