Taking you literally, I'm not sure you need regex. If you know or can
find position n, then can't you just:

sentence = "the color is $red"
patterns = ["blue","red","yellow"]
pos = sentence.find("$")
for x in patterns:
    if x==sentence[pos+1:]:
        print x, pos+1

But maybe I'm oversimplifying.

rpd

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

Reply via email to