in reply to Maybe Escape in Dynamic RegExps
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.
Electric eels were invented at the same time as electricity
Before electricity was invented, electric eels had to stun with gas
Results (376 votes). Check out past polls.