develooper Front page | perl.perl5.porters | Postings from December 2010

Re: RFC: Restatement of /a regex proposal

Thread Previous | Thread Next
December 6, 2010 02:14
Re: RFC: Restatement of /a regex proposal
Message ID:
On Sun, Dec 05, 2010 at 10:01:03PM -0700, karl williamson wrote:
> Another wrinkle.  In looking through the code I identified several more  
> possible things that might ought to be restricted to ASCII by /a.  Does  
> anyone have an opinion on these?:
> \h
> \v
> \R
> \X

I have an opinion.

I hardly see any code using \h, \v, \R and \X, and if it's used,
it's seldomly *mis*used to mean just the ASCII subset of their 
meaning. They are new enough to never had a pre-5.6 meaning which
is still present in books and documentation. There has never been
an opportunity for people to make mistakes as with \d, \w and \s.

I see /a as a way to correct (or revert) the changes introduced in
5.6. As there's no need to revert \h, \v, \R, I rather not see their
meaning change under /a.

As for \X, I think /\X/a having match only ASCII characters is rather
pointless. For the same reason, I don't think /\C/a should match a
different set of characters than /\C/ does.

Deep down, I really only care about \d, \D, \w, and \W. [[:posix:]] 
I see so infrequently used, that while I think it's nice to be fixed,
it doesn't bother me that much. And \s matching outside of the ASCII
range usually doesn't lead to potential problems.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About