Regular expression problem with groups
kowald at molgen.mpg.de
Mon Aug 16 17:08:15 CEST 2004
I have a 'simple' problem with regular expressions. Maybe someone can
bla = 'the the'
obj = re.search('(.+) \1',bla)
obj.group(1) should now be 'the'. Instead obj is none (python 2.3
under windows and 2.1 under linux). The problem seems to be the \1
where I try to reference the first group. However, every tutorial says
this is the correct way to do it !?
Any ideas what I'm doing wrong ?
More information about the Python-list