We're back after a server migration that caused effbot.org to fall over a bit harder than expected. Expect some glitches.

Why doesn't my regular expression work?

Typically, it’s an issue between re.match and re.search. Match matches the beginning only and search checks the entire string. See the regular expression HOWTO for more details:

http://www.amk.ca/python/howto/regex

Also, Python comes with a handy program for testing regular expressions, in Tools/scripts/redemo.py.

CATEGORY: tutor