develooper Front page | perl.perl5.porters | Postings from April 2017

Re: [perl #128420] Changes in regex recursion in 5.24

Thread Previous
From:
Jan Goyvaerts
Date:
April 12, 2017 09:31
Subject:
Re: [perl #128420] Changes in regex recursion in 5.24
Message ID:
58EDF3A9.90902@jgsoft.com
demerphq wrote:

>> Dinkumware's implementation of std::regex (and possibly other
>> implementations) support [:w:], [:s], and [:d:] as shorthands for [:word:],
>> [:space:], and [:digit:].
> 
> Do you know why? Do they not support \w \s and \d?

std::regex supports \w, \s, and \d when using its "ECMAScript" grammar 
but not when using the basic, extended, grep, egrep, or awk grammars.

boost::regex supports \w, \s, \d, and \h in all grammars.  It does not 
support \v as a shorthand.  So [[:v:]] is the only concise way of 
matching vertical whitespace in Boost.

> 1. I think in the next release we should produce a deprecation warning
> when we see anything that is POSIX-char-class-like but which is
> invalid.
> 
> 2. Then in a release or so afterwards we could make them errors.
> 
> 3. Then in a release or so after that we could add support for these
> short forms if we wanted.

Sounds like a good plan to me.  Anyway, RegexBuddy will emulate whatever 
you guys decide.

Another inconsistency you have right now is that Perl 5.24 does throw 
errors about unknown POSIX classes for [[:a-z:]] and [[:a!z:]] but not 
for [[:az:]] or [[:A-Z:]].

Kind regards,
Jan Goyvaerts

--
http://www.just-great-software.com

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