There a couple of good programs for testing regex-es live. My favourite is Regex Coach by the awesome Edi Weitz:
http://weitz.de/regex-coach/ - It's Windows only though
There are many others, but his one thought me quite a lot
http://weitz.de/regex-coach/ - It's Windows only though
There are many others, but his one thought me quite a lot
also, python's regex module can show you how it interprets a regular expression by passing the re.DEBUG flag to re.compile:
>>> import re
>>> re.compile('a*b+', re.DEBUG)
max_repeat 0 65535
literal 97
max_repeat 1 65535
literal 98
<_sre.SRE_Pattern object at 0x100460230>