Python-equivalent of PHP addslashes/stripslashes functions?

maxm maxm at mxm.dk
Thu Nov 1 00:05:55 CET 2001


http://www.python.org/doc/current/lib/Contents_of_Module_re.html

escape(string)

Return string with all non-alphanumerics backslashed; this is useful if you
want to match an arbitrary literal string that may have regular expression
metacharacters in it.

regards Max m

"Leeuw van der, Tim" <tim.leeuwvander at nl.unisys.com> wrote in message
news:mailman.1004529931.3668.python-list at python.org...
> Hello,
>
> I'd like to know if there's a Python-alternative to the very convenient
PHP
> functions addslashes / stripslashes which add cq remove backslashes to
> things like ', " characters, so that values from HTML forms can be safely
> passed around to other programs, used in SQL statements, etc.
>
> Any pointers?
>
> Thanks in advance,
>
> --Tim
>
>





More information about the Python-list mailing list