Hello, I'm looking for a regular _expression_ which will match strings as follows: if there are symbols a, b, c and d, then any pattern is valid if it begins with a and ends with d and proceeds in order through the symbols. However, at any point the pattern may reset to an earlier position in the sequence and begin again from there.
For example, these would be valid patterns:
aabbbaabbcccbbbcccddd
aabcabcd
abcd

But these would not:
aaaaabbbbbccccaaaaadddd   (goes straight from a to d)
aaaaaaaaaaabbbbbccc (does not reach d)

Can anyone think of a concise way of writing this regex? The ones I can think of are very long and awkward.
Gabriel
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to