Hostmask matching

Marc Schoechlin mslists at 256bit.org
Sun Jun 4 02:26:17 EDT 2006


Hi !

Nexu <nexu.jin at gmail.com> schrieb:
> I'm trying to write a def to match a string that is an irc hostmask. eg:
> *one!~*name at a??-??-101-101.someisp.com
> But using re.search(). I get an error when the string starts with '*'.
> What is the best way to solve this?

I suppose the problem occurs because you expression is not a valid
regular expression.

A correct regular expression should look like this:
".*one!~.*name at a..-..-101-101.someisp.com"

Best regards

Marc Schoechlin

-- 
I prefer non-proprietary document-exchange.
http://sector7g.wurzel6.de/pdfcreator/
http://www.prooo-box.org/
Contact me via jabber: ms at 256bit.org



More information about the Python-list mailing list