backreference in regexp
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

backreference in regexp

From: Schüle Daniel <uval@rz.uni-karlsruhe.de>
Date: Tue Jan 31 2006 - 15:15:04 CET

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
Received on Tue Feb 7 20:21:35 2006