__license__ = "MIT | Public Domain"
+# rule is a function that takes text and returns either
+# None (not mathed) or a list of three text items:
+# [ not-matched, processed, the-rest ]
+ """ replace text links with HTML links """
+ linkre = re.compile('https?://\S+')
+ # [ ] test with commas and other URL escaped symbols
+ match = linkre.search(text)
+ return (text[:match.start()], "[link]", text[match.end():])
+print rule_linkify("a web site http://google.com")
+# [ ] sets of common rules
+# [ ] configurable replacements
+# [ ] indented prints after every step