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

To see if I understand, qr/[a-z]/ is to be seen as class consisting of a range, but qr/[\w-\d]/ is to be seen as a class composed by the difference between sets?

Would qr/[\d-89]/ find only octal digits or would it find the 9 too?

--
[ e d @ h a l l e y . c c ]

Replies are listed 'Best First'.
Re: Re: Re: Why does \w include numbers and underscore?
by japhy (Canon) on Apr 22, 2004 at 15:19 UTC
    If I understand TR18 correctly, it would match only octal digits. All the examples in TR18 show additional brackets or give whitespace to help make things clear.

    Union binds tighter than intersection, which binds tighter than subtraction, so [\d-89] is the same as [\d-[89]].

    _____________________________________________________
    Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a job (NYC-area)
    s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;