develooper Front page | perl.perl5.porters | Postings from February 2012

Re: [perl #109798] '/e' regexp modifier is not recognized by re pragma

Thread Previous | Thread Next
From:
Eric Brine
Date:
February 4, 2012 20:54
Subject:
Re: [perl #109798] '/e' regexp modifier is not recognized by re pragma
Message ID:
CALJW-qFqnmsK_ie7d5J3hQGB91C9-xCVxfNxNHqj4vy+oXuszQ@mail.gmail.com
On Sat, Feb 4, 2012 at 8:24 PM, Tom Christiansen <tchrist@perl.com> wrote:

> "Eric Brine via RT" <perlbug-followup@perl.org> wrote
>   on Sat, 04 Feb 2012 16:19:41 PST:
>
> > Also note that "e" is not mentioned in perlre. The regex flags
> > are (as listed in perlre): m, s, i, x, p, g, c, a, d, l, u.
>
> That's incorrect, and potentially misleading.
>

>
With blank lines removed for brevity, these are
>
the only pattern modifiers:
>

You removed "g" and "c", but they are accepted in patterns:

>perl -wcE"qr/(?c:foo)/;"
Useless (?c) - use /gc modifier in regex; marked by <-- HERE in m/(?c <--
HERE :foo)/ at -e line 1.
-e syntax OK

>perl -wcE"qr/(?g:foo)/;"
Useless (?g) - use /g modifier in regex; marked by <-- HERE in m/(?g <--
HERE :foo)/ at -e line 1.
-e syntax OK

I don't know why that is.

If anything is misleading is that they are listed as pattern modifiers
(which are listed in perlre) instead of operator modifiers (which are
listed in perlop).

- Eric

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About