regular expression - re module

Zoltan Nemeti zmeneti at chello.hu
Fri Dec 20 16:43:43 EST 2002


Greetings!
I'd like to create a re pattern, which should match
every host names except of the subdomains: red|green

My hostnames consist of 3 or more parts, like
  - b.a.com
    Z.Y.X.W.com

I'd like to match everything except of red|green
at the 3rd pos. from right:

So  Z.Y.X.red.W.com        and
     b.green.a.com          shouldn't match

but Z.Y.X.heavy.W.com      should match, and so on.

I'd like to use a general pattern, so only red|green
should be specific. For my pleasure...

Thank you for your help!
Zoltan




More information about the Python-list mailing list