SparkyGuy <sparkyguy@[EMAIL PROTECTED]
> wrote:
# I want to build a regular expression that will find certain characters
in a
# field. For example:
#
# i,n,t,u,o,n
#
# all need to be present (at least once) for the RegEx interpreter to
label
# this search True. The order is not im****tant, and case should be
ignored.
#
# I tried
#
# [Ii][Nn][Tt][Uu][Oo][Nn]
#
# and
#
# [Ii].*[Nn].*[Tt].*[Uu].*[Oo].*[Nn]
#
# No joy.
The software really isn't intended to be used this way. It would
be simpler to conjoin a number of searches. Assuming an interface
like
numberofmatches = regexp(pattern,string)
you can do something like
regexp("[Ii]",string)==1
&& regexp("[Nn]",string)==2
&& regexp("[Tt]",string)==1
&& regexp("[Uu]",string)==1
&& regexp("[Oo]",string)==1
Some interfaces also allow a flag to ignore character case.
regexpnocase("i",string)==1
&& regexpnocase("n",string)==2
&& regexpnocase("t",string)==1
&& regexpnocase("u",string)==1
&& regexpnocase("o",string)==1
To do this in a single RE, you have to use all 120 permutations,
[^IiNnTtUuOoNn]*[Ii][^IiNnTtUuOoNn]*[Nn][^IiNnTtUuOoNn]*[Tt]...
|[^IiNnTtUuOoNn]*[Ii][^IiNnTtUuOoNn]*[Uo][^IiNnTtUuOoNn]*[Nn]...
|...
--
SM Ryan http://www.rawbw.com/~wyrmwif/
GERBILS
GERBILS
GERBILS


|