G
gentsquash
In a setting where I can specify only a JS regular
expression, but not the JS code that will use it, I seek
a regexp component that matches a string of letters,
ignoring case. E.g, for "cat" I'd like the effect of
([Cc][Aa][Tt])
but without having to have many occurrences of [Xx].
Secondly, what is an efficient regexp that matches a
string exactly when ALL words in a certain list occur in
the string. I'd like the effect of
(cat.*nip|nip.*cat)
except that there are N words rather than just the two
words "cat" and "nip". (I can assume that no word in the
list is a prefix of any other.) Naturally, I'm looking for
a regexp-solution that does not involve listing all
N factorial
many orderings.
--Jonathan LF King, Mathematics dept, Univ. of Florida
expression, but not the JS code that will use it, I seek
a regexp component that matches a string of letters,
ignoring case. E.g, for "cat" I'd like the effect of
([Cc][Aa][Tt])
but without having to have many occurrences of [Xx].
Secondly, what is an efficient regexp that matches a
string exactly when ALL words in a certain list occur in
the string. I'd like the effect of
(cat.*nip|nip.*cat)
except that there are N words rather than just the two
words "cat" and "nip". (I can assume that no word in the
list is a prefix of any other.) Naturally, I'm looking for
a regexp-solution that does not involve listing all
N factorial
many orderings.
--Jonathan LF King, Mathematics dept, Univ. of Florida