develooper Front page | perl.perl5.porters | Postings from October 2009

Re: What should \s \w \d match in 5.12?

Thread Previous | Thread Next
From:
Eric Brine
Date:
October 4, 2009 16:29
Subject:
Re: What should \s \w \d match in 5.12?
Message ID:
f86994700910041628t783a827fu2971a21df721f13@mail.gmail.com
On Sun, Oct 4, 2009 at 5:20 PM, Abigail <abigail@booking.com> wrote:

> I would personally favour if \d becomes just a shortcut for [0-9], and \w a
> shortcut for [a-zA-Z_0-9]. All the time. Regardless of internal encoding
> of the subject string, the locale, or how the regexp itself is encoded.
>

I noticed you didn't touch \s, which is the one that troubles me (too?). I
often use \d and \w in patterns that are captured. It's good to match
tightly, so I agree with you. \s, on the other hand, matches parts of the
input I usually wish to discard. Having it behave laxly (i.e. match
characters such as NBSP) would benefit me.

- ELB


Thread Previous | 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