This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
"**Pycco**" is a Python port of [Docco](http://jashkenas.github.com/docco/): | |
the original quick-and-dirty, hundred-line-long, literate-programming-style | |
documentation generator. It produces HTML that displays your comments alongside | |
your code. Comments are passed through [Markdown][markdown] and | |
[SmartyPants][smartypants][^extensions], while code is passed through | |
[Pygments](http://pygments.org/) for syntax highlighting. | |
[markdown]: http://daringfireball.net/projects/markdown/syntax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p>Regular expressions (regex) provide a pattern matching scheme you can use to search and manipulate strings. Although regex has been around for almost 50 years, it is often either completely ignored or relegated to the “will learn later” pile by many programmers. Regex is indeed borderline witchcraft that at first glance looks like it was culled from the script of <a href="https://www.youtube.com/watch?v=Ln7WF78PolA">Plan 9 from Outer Space</a>. (It wasn’t!).</p> | |
<p>There is an old programming adage that goes: “One time I had a problem so I tried to solve it with regular expressions. Now I have two problems.” If you're not careful, that old saying sums up regex well. If you get in a hurry or try to over-complicate things, regex will get you in more trouble than cheating on your taxes. But with a little effort and practice, knowing how and when to use a regular expression to solve a problem will make your code better, easier to read (really!), and easier to maintai |