For instance, say I wanted a function to escape a string for use in HTML (as in Django\'s escape filter):
def escape(string): \"\"\" Retu
Apparently it's pretty common to implement that via regex. You can find an example of this at ASPN and here.