Re: using regex to remove $ sign

2006-04-11 Thread Tim Chase
> i have an html/cgi input that takes in values to a mysql > database, however, if i stick in $20 instead of 20, it > crashes the program because of the extra $ sign. I was > wondering if anyone has a quick regular expression in > python to remove the $-sign if it is present in the > input. While

Re: using regex to remove $ sign

2006-04-11 Thread John Machin
[EMAIL PROTECTED] wrote: > Fredrik Lundh>RE? ex-perler? try strip+lstrip instead:< > > Or even: > >>> text = " $12921 " > >>> text.replace("$", "") > ' 12921 ' That's fair enough with the given input, but it would silently swallow the "$" in "123$5678" -- this sort of approach leads to al

Re: using regex to remove $ sign

2006-04-11 Thread bearophileHUGS
Fredrik Lundh>RE? ex-perler? try strip+lstrip instead:< Or even: >>> text = " $12921 " >>> text.replace("$", "") ' 12921 ' Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: using regex to remove $ sign

2006-04-11 Thread Fredrik Lundh
"Kun" <[EMAIL PROTECTED]> wrote: > i have an html/cgi input that takes in values to a mysql database, > however, if i stick in $20 instead of 20, it crashes the program > because of the extra $ sign. I was wondering if anyone has a quick > regular expression in python to remove the $-sign if it i

using regex to remove $ sign

2006-04-11 Thread Kun
i have an html/cgi input that takes in values to a mysql database, however, if i stick in $20 instead of 20, it crashes the program because of the extra $ sign. I was wondering if anyone has a quick regular expression in python to remove the $-sign if it is present in the input. -- http://mail