I applaud your effort. Regex is a valuable skill (really, language) which you will use across languages and programs as it gives you access to an efficient and pretty general method for scanning and extracting things from text. And if you study fundamentals of computer science (like the Chomsky hierarchy) you will also find that regular expressions are important there too.
> I would expect Repetition to act like Wildcards but ' + ' is not a wildcard.<p>The meaning of the term "wildcard" may be ambiguous. The plus sign, called a "repetition operator", is used to modify what precedes it, like this:<p>\w+ will match one or more word characters. Word characters are usually in the set A-Z, a-z, 0-9 and the underscore.<p>In much the same way, \w* will match zero or more word characters.<p>And \w? will match zero or one word characters.<p>If you want to use one of these repetition operators in your search, preceded it with a reverse slash:<p>"true\?" will match "true" followed by a question mark, while "true?" will match "tru" optionally followed by "e".
For a good nerdy time, check out the first implementations of glob and regexp. 20 years on they still work in modern Pythons. Soon after Guido decided to make globs a special case of regexp, and his elegant recursive code was no more.<p><a href="http://svn.python.org/view/python/trunk/Lib/glob.py?revision=2268&view=markup" rel="nofollow">http://svn.python.org/view/python/trunk/Lib/glob.py?revision...</a><p><a href="http://svn.python.org/view/python/trunk/Lib/sre_compile.py?revision=14919&view=markup" rel="nofollow">http://svn.python.org/view/python/trunk/Lib/sre_compile.py?r...</a>
In case you're curious, here's what I consider a modern pythonic solution - <a href="https://gist.github.com/1995010" rel="nofollow">https://gist.github.com/1995010</a>