develooper Front page | perl.perl5.porters | Postings from September 2011

Re: Regex warning

Thread Previous
From:
David Nicol
Date:
September 22, 2011 07:24
Subject:
Re: Regex warning
Message ID:
CAFwScO-ZM2CoCGwrT2yerZbtx9JHLcRVjz9arA2hwf0CWaQ1-g@mail.gmail.com
On Thu, Sep 22, 2011 at 5:30 AM, Tom Christiansen <tchrist@perl.com> wrote:
> but how best to inline it inside a (?....) is less than perfectly clear.
>
> At least to me.
>
> --tom

The first thing is to get interpolation of regexes within regexes to
be tree splices instead of translations to source and then
recompilation. Once that's in place, a symbol can have multiple local
meanings in different parts of the same regex, using the existing
syntax for "run this bit of source and interpolate the result at
string assembly time."  Which is,

   ${\do{ use re boundary => "fancy words"; qr/\b/ }}

Thread Previous


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