in reply to Re^5: better (faster) way of writing regexp
in thread better (faster) way of writing regexp

Well, it's not that hard to write a perl one-liner and see if any of them matches \d, is it?
Actually it is... From the links pointed out in Re^3: better (faster) way of writing regexp, I concluded that the exact interpretation of \d in Perl is still under discussion, and at least not implemented yet in Perl 5.8 (which is running here); and, I have not found an easy way to use Unicode on the Command Line in Windows 2000.

As I said before, to be considered a digit, you'll have to be a number between 0 and 9
... which would apply of 'ichi' (1), but, as you point out, certainly not for 'jue' (10).

UPDATE: My comment regarding windows command line was silly. I can always represent Unicode characters by \x(...), so, yes, you are right, it would have been easy to have written a short perl program to test it!
-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^7: better (faster) way of writing regexp
by JavaFan (Canon) on Dec 02, 2009 at 17:49 UTC
    I concluded that the exact interpretation of \d in Perl is still under discussion, and at least not implemented yet in Perl 5.8 (which is running here);
    \d has been implemented for a long time. Probably it was already in Perl 1.0.0.

    The meaning of \d may change, but I don't think consensus has been reached on the change (some people want \d to match [0-9], but Larry has said Perl5 should not, which means that due to Rule 1, \d is likely to continue matching all Unicode digits). Considering that Jesse has declared a feature freeze for 5.12, the earliest Perl where \d may no longer match all Unicode digits will 5.14, but then only if Rule 1 can be revoked (using Rule 2, I presume).

    As I said before, to be considered a digit, you'll have to be a number between 0 and 9
    ... which would apply of 'ichi' (1)
    I won't deny that. But please read the part of the sentence that follows "0 and 9". I didn't intent that part to be optional. The Chinese numbering system has symbols for 0 .. 10, 100, 1000, and other powers of 10. As such, they ain't digits.

    Now, you want to argue that 一 should match /\pN/, but that's something you would have to take up with the Unicode Consortium - Perl just follows their definition.