backreference in regexp



X-Enigmail-Version: 0.76.5.0
X-Enigmail-Supports: pgp-inline, pgp-mime
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hello @all,

>>> p = re.compile(r"(\d+) = \1 + 0")
>>> p.search("123 = 123 + 0")

'search' returns None but I would expect it to
find 123 in group(1)

Am I using something that is not supported by Python
RegExp engine or what is the problem with my regexp?

Regards, Daniel

.



Relevant Pages

  • Re: backreference in regexp
    ... Schüle Daniel wrote: ... > RegExp engine or what is the problem with my regexp? ... you have to escape it: ... Prev by Date: ...
    (comp.lang.python)
  • Re: sort the list
    ... > works for Python 2.4 ... > in earlier Pythons just let cmp = .. ... > Regards, Daniel ... Prev by Date: ...
    (comp.lang.python)
  • Re: regexp problem
    ... In real life I ... as the regexp engine is faster. ... Prev by Date: ...
    (comp.lang.tcl)