Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

regex

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"?

Name: Anonymous 2012-01-11 19:08

Sounds like a context-dependant grammar aka NP-complete aka impossible to solve with today's technology.  Maybe we will prove that P=NP and then you'll be able to solve this.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List