Name: sage 2012-01-11 18:23
Is there a common regex notation for "at least one of each?"
For example, I want to specify that a string must contain "a", "b", and "c" in any order. So these are all matched:
"abcabcabcbacbacb"
"acb"
"aaabbbccc"
"cba"
"cccbbbaaa"
but not "ab" or "aaaaaaaaaaaabbbbbbb".
Similarly, how about "exactly one of each" so that one_of_each("a" "b" "c") would match
abc
acb
bca
but not "aabc" or "aaaaa"?
For example, I want to specify that a string must contain "a", "b", and "c" in any order. So these are all matched:
"abcabcabcbacbacb"
"acb"
"aaabbbccc"
"cba"
"cccbbbaaa"
but not "ab" or "aaaaaaaaaaaabbbbbbb".
Similarly, how about "exactly one of each" so that one_of_each("a" "b" "c") would match
abc
acb
bca
but not "aabc" or "aaaaa"?