[Tutor] need help with a regular expression

Lie Ryan lie.1296 at gmail.com
Sat Jun 28 14:21:50 CEST 2008


Filter it. Use two re, one the one you've made, the other the double
hyphen filter:

pat2 = re.compile('.*?\-\-.*?')

If the string matches this re, then the string is rejected, if it DOES
NOT match (i.e. pat2.match('blah') returns None, i.e. if not
pat2.match('blah')), then it is accepted.

btw: You don't care about small letter?



More information about the Tutor mailing list