Regular Expression match

AON LAZIO aonlazio at gmail.com
Fri Sep 24 18:45:43 EDT 2010


Hi,
   Say I have
   p     = re.compile('a|b')
   text = 'a'
   d     = p.findall(text)
   #d -> ['a']
   What is the way to find out which pattern p match (the former or latter)?
I mean without knowing the outcome of p.findall
   Thanks

-- 
Aonlazio
'Peace is always the way.' NW
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100924/7cfe4025/attachment.html>


More information about the Python-list mailing list