Here is Dr. Chuck's RegEx "cheat sheet". You can also download it here:
www.dr-chuck.net/pythonlearn/lectures/Py4Inf-11-Regex-Guide.doc
Here's Dr. Chucks book on learning python: www.pythonlearn.com/html-270
For more information about using regular expressions in Python, see docs.python.org/2/howto/regex.html
Regex: positive lookbehind assertion
(?<=...)
Matches if the current position in the string is preceded by a match for ... that ends at the current position.
eg.
s="Yes, taters is a synonym for potaters or potatoes."
re.sub('(?<=po)taters','TATERS', s)
'Yes, taters is a synonym for poTATERS or potatoes.'
Or example from python doc:
m = re.search('(?<=abc)def', 'abcdef')
m.group(0)
'def'
|