This does what you want. my $re = qr/(?<!\Q$c\E)\Q$d\E/; The \Q . . \E pair is like quotemeta. I've changed the names to protect sort. Extra ( . . ) delimiter pair is cut.
After Compline,
Zaxo
In reply to Re: Maybe Escape in Dynamic RegExps
by Zaxo
in thread Maybe Escape in Dynamic RegExps
by stefan k
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |