neilwatson has asked for the wisdom of the Perl Monks concerning the following question:
Greetings. This code returns the error 'Search pattern not terminated'. I think it's the '{' inside the regex, but shouldn't that be automatically escaped by \Q\E?
#!/usr/bin/env perl use strict; use warnings; my $regex = qr{ \n (?: \QI'll be good.\E | Hushing | Hrumph | \Q>:[\E | \Q:-(\E | \Q:(\E | \Q:-c\E | \Q:c\E | \Q:-<\E | \Q:< +\E | \Q:-[\E | \Q:[\E | \Q:{\E | \Q:-|\E | \Q:@\E | \Q>:(\E | \Q:' +-(\E # here? ^^^^^ | \Q:'(\E | \QShutting up now.\E | \QBut, but...\E | \QI'll be quiet.\E ) }mix;
Neil Watson
watson-wilson.ca
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Regex Search pattern not terminated error
by Athanasius (Archbishop) on Mar 12, 2016 at 15:32 UTC | |
Re: Regex Search pattern not terminated error
by ww (Archbishop) on Mar 12, 2016 at 15:51 UTC | |
Re: Regex Search pattern not terminated error
by choroba (Cardinal) on Mar 12, 2016 at 15:41 UTC |