A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/333532.html below:

backreferences

backreferences backreferencesIain King iainking at gmail.com
Wed Sep 28 10:09:44 EDT 2005
Amy Dillavou wrote:
> Can someone help me with understanding how python uses backreferences?
> I need to remember the item that was last matched by the re engine but i
> cant seem to understand anything that I find on backreferences.  if I
> want to access the last match do i use \number or is there something
> else i have to do?
>
> heres part of my code:
> renDate = re.compile("$((\d){4}-(\d){2}-(\d){2}))")
> renDate.search(l)
> if(exist.search(l) and str(lastmodDate) < \1): #i need help here with \1
>
> Thanks in advance
> A.D

I haven't had to use backreferences yet, so I don't know offhand how to
go about it.  What I do know is that this online book is very useful:

http://gnosis.cx/TPiP/


Chapter 3 covers REs:

http://gnosis.cx/TPiP/chap3.txt

>From what I remember, in python you can use numbered backreferences (up
to 99), or named ones.

Iain


More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4