[mod_python] spaces from a web form

Rakotomandimby Mihamina mihamina at gulfsat.mg
Wed Jul 22 23:49:52 EDT 2009


Hi all
let the following simplified code be:

   import re
   textarea=for.getfirst('text')
   spaces=re.compile('^( )+$')
   new_txt=re.sub(spaces, '_', textarea)

The HTML is a very simple form with a textarea.
The substitution doesnt occur. The '+' signs
in the Url seem to be stripped and replaced by
something not matched as a space;

I already tried with something like "\s" in the regexp
but no more luck. Any more tips?
Thank you.

-- 
                             Architecte Informatique:
    Administration Systeme, Recherche & Developpement
                                   + 261 32 11 401 65
Pensez a l'environnement avant d'imprimer ce message


More information about the Mod_python mailing list