regex walktrough

Hans Mulder hansmu at
Sun Dec 9 00:27:30 CET 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)))

You wouldn't want to see the complete list.

-- HansM

More information about the Python-list mailing list