Re: spaces from a web form
Amand Tihon <[email protected]> Thu, 23 Jul 2009 07:38:35 +0200
| Newsgroups | gmane.comp.python.mod_python |
|---|---|
| Message-ID | <[email protected]> |
Le jeudi 23 juillet 2009 05:49:52, Rakotomandimby Mihamina a écrit :
> Hi all
> let the following simplified code be:
>
> import re
> textarea=for.getfirst('text')
> spaces=re.compile('^( )+$')
This regexp will only match a string that contains nothing else than one or
more spaces.
^ start of the string
( )+ one or more space
$ end of the string
Remove the caret and the dollar sign, and it should be fine.
--
Amand Tihon
1 Rue du Ruchaux, 1490 Court-St-Etienne, Belgium
+32 479 207 743
_______________________________________________
Mod_python mailing list
[email protected]
http://mailman.modpython.org/mailman/listinfo/mod_python
signature.asc
(application/pgp-signature, 481 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iQEVAwUASmf3W2wEC4yK7XCzAQiQEAf/XaLWchORH7WQlecwwpkOGnCrjUHDLTYv hkcs71nOONHxvr8y1WKC3mLzA84tcSBXFDRPNyWyi0WOIYJvjigHn6TRU0MUZpp5 ECyQgigG3Uek/v/qnLSAIeLsc9B8cMgzXOjkVbVRL225tXEgKzl1sYISPpinFlpt wqGupGIGNouciNEnjJdLs6827YHi9ZCtzj7Y2DenZqKysbvVJ/4ccQzhej/b8fMZ 8x0qR4DQZ/Ee3VdvAWCXlPaGvVOy80em1p2waXsGgO9fPRcb/6GheU9hGQV/ovP9 J+gRJgImhhw6bc7DlWBVL0o8pUPYoMwOnVDrfDqKUecZnIzjABhJIQ== =dNn3 -----END PGP SIGNATURE-----