regex walktrough

Hans Mulder hansmu at xs4all.nl
Sat Dec 8 18:27:30 EST 2012


On 8/12/12 23:19:40, rh wrote:
> I reduced the expression too. Now I wonder why re.DEBUG doesn't unroll
> category_word. Some other re flag?

he category word consists of the '_' character and the
characters for which .isalnum() return True.

On my system there are 102158 characters matching '\w':

>>> sum(1 for i in range(sys.maxunicode+1)
...     if re.match(r'\w', chr(i)))
102158
>>>

You wouldn't want to see the complete list.

-- HansM



More information about the Python-list mailing list