3 ms·
Hmm, okay. It seems to just use Python's unicode escape syntax, instead of what the standard says. But the package does support things like the complex characte
by rspeer 8y ago
Hmm, okay. It seems to just use Python's unicode escape syntax, instead of what the standard says. But the package does support things like the complex character classes, and identifying word boundaries.
(The algorithm for identifying word boundaries in most languages without ASCII/English assumptions is quite complex and useful, as I can say from having tried to reinvent half of it before learning about the standard and the regex package. It's not a panacea -- it won't do anything useful with languages where word boundaries require lexical knowledge, like Chinese, Japanese, and Thai -- but other than that it handles all the edge cases you never would have thought of.)
- burntsushi 8y agoYeah, basically, the standard is a little sneaky on this point. It doesn't actually require a specific syntax, but rather, simply that being able to write Unicode codepoints in hexadecimal representation is possible. Notice that it says, "... shall supply a mechanism ..." rather than "this mechanism." Of course, it's probably a good idea to follow the sample syntax provided. :-)