in reply to Why does \w include numbers and underscore?

Historically, the awk and sed regex engines had a \w that supported underscores and perl was designed as a much improved version of these tools. Don't know the history before that, but I suspect it is derived from the idea that C identifiers can contain letters, numbers and underscores. You can use Unicode character classes for alpha matching:
$x =~ /^\p{IsAlpha}/;
See perlretut for more examples.

-Mark

Replies are listed 'Best First'.
Re: Re: Why does \w include numbers and underscore?
by fizbin (Chaplain) on Apr 22, 2004 at 14:55 UTC
    Note that if you for some reason prefer POSIX names for these character classes, you can do this:
    $x =~ /^[:alpha:]/;
    More can be found in perlre.