matching any number of any character

Lyn A Headley laheadle at boguscs.uchicago.edu
Mon Aug 23 02:19:58 CEST 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