debugging python regexes

July 5th, 2010 § 0 comments

Neat trick from stackoverflow: the re.DEBUG flag for python regexes:


> re.compile('a(b+)a', re.DEBUG)
literal 97
subpattern 1
max_repeat 1 65535
literal 98
literal 97

What's this?

You are currently reading debugging python regexes at Dan O'Huiginn.

meta