simple pattern matching question

Corey G. ctgaff at attbi.com
Wed Jun 5 22:28:19 EDT 2002


Gurus,

How would I match with an item from a list?  I would imagine something
this simple would not require a regular expression.

web_servers=('www01','www02','www03')

        for server_match in web_servers:
           if (trap == "Service:"server_match "State:down"):
	      print "found match"

The comparsion should be: if trap == Service:www01 State:down

server_match prints "as is, but not from the list".  I tried many 
combinations but decided to leave the most obviously wrong one.

-- 
Best Regards,
Corey





More information about the Python-list mailing list