matching any number of any character

Lyn A Headley laheadle at boguscs.uchicago.edu
Sun Aug 22 20:19:58 EDT 1999


To do it, I want to use the regex module, heretical though that may
be.  I think my brain is missing a piece, because I can't seem to
accomplish such a task.  I thought this would work:

>>> import regex
>>> rx = regex.compile('\(.\|\n\)+')
>>> rx.match('abc')
3
>>  rx.group(1)
'c'

but I wanted 'abc'!

little help?

-Lyn




More information about the Python-list mailing list