in reply to Regex Search pattern not terminated error
Hello neilwatson,
You are right about two things:
What’s happening here (and it took me a while to figure it out!) is that the qr expression is also using braces as its delimiter. So the Perl parser first looks for the end of the whole qr{...} expression, and thinks it has found it when it encounters the first right brace; only later does it implement \Q ... \E to backslash non-word characters.
To fix this, either escape the brace manually (\Q:\{\E) or (better) change the delimiter: my $regex = qr! \n ... !mix;
Hope that helps,
Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
---|