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

Deprecating '\w {' in v5.16

Thread Next
From:
Karl Williamson
Date:
January 22, 2012 19:41
Subject:
Deprecating '\w {' in v5.16
Message ID:
4F1CD6EF.4030807@khwilliamson.com
I was cleared to deprecate the sequence backslash, 
ASCII-alpha-character, left brace in 5.14 in regular expression 
patterns, but in looking through the list of candidates someone 
furnished, I saw only two that I thought we would ever might want to 
co-opt, and so \b{ and \B{ are now deprecated; I have heard of no user 
complaints.

But I and others think that there are uses for other sequences, such as 
\w{, and I wondered why I hadn't thought so before.  It turns out that 
the list which I blindly accepted didn't contain that as a possibility.

So now, I would like to get clearance to deprecate this sequence, for 
any ASCII alpha character for which it is not already defined.

In an earlier thread, someone pointed out that \w{3,4}, for example has 
current meaning.  Of course we can't change that.  It would be handled 
the same way we currently handle sequences like

	\x{41}{3,4}

which means to match 3 or 4 'A's in a row, or

	\N{COLON}{0,}

meaning to match any number of ':' characters in a row.  We could at 
some point v5.20 or later define

	\w{foo}{1,}

to mean at least one of whatever \w{foo} is chosen to mean.

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