Hi,

I'd need to perform simple pattern matching within a string using a
list of possible patterns. For example, I want to know if the substring
starting at position n matches any of the string I have a list, as
below:

sentence = "the color is $red"
patterns = ["blue","red","yellow"]
pos = sentence.find($)
# here I need to find whether what's after 'pos' matches any of the
strings of my 'patterns' list
bmatch = ismatching( sentence[pos:], patterns)

Is an equivalent of this ismatching() function existing in some Python
lib?

Thanks,

Olivier.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to