f*cking re module

jwaixs jwaixs at gmail.com
Mon Jul 4 04:04:47 EDT 2005


arg... I've lost 1.5 hours of my precious time to try letting re work
correcty. There's really not a single good re tutorial or documentation
I could found! There are only reference, and if you don't know how a
module work you won't learn it from a reference!

This is the problem:

>>> import re
>>> str = "blabla<python>Re modules sucks!</python>blabla"
>>> re.search("(<python>)(/python>)", str).group()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: 'NoneType' object has no attribute 'group'

the only thing I want are the number of places blabla, Re modules
sucks! and blabla are.

Noud




More information about the Python-list mailing list