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

RFC: use re '/x[]';

Thread Next
From:
Karl Williamson
Date:
September 5, 2014 17:56
Subject:
RFC: use re '/x[]';
Message ID:
5409F931.7040602@khwilliamson.com
I'm proposing two additions to the "use re" pragma.  One is covered 
here, and the other in a separate thread, to lessen confusion.

This pragma would mean that any patterns compiled within its scope would 
be /x, but additionally any white-space in bracketed character classes 
would be ignored unless escaped.  This is already the behavior of the 
experimental feature (?[...]).

This would allow a programmer to optionally extend this behavior to 
regular bracketed character classes.  White-space can make these much 
more legible.

I do not propose making '#' special, to introduce a comment.  A '#' in a 
[...] would continue to mean \N{NUMBER SIGN}, as how (?[...]) behaves now.

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