How about
my_string = "We the people of the United States, in order to form a
more perfect union, establish justice, insure domestic
tranquility,......"
print (x for x in my_string.split(",") if "justice" in x).next()
This isn't a regular expression, but it gives what you're looking for.

THN

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

Reply via email to