A
Anthony Durity
Hello all,
I've got a tricky puzzle.
Imagine I have a bunch of n RegExps r[] - they could be any valid ruby Rege=
xps.
Say I want to match each of them in turn to a certain something s to
make sure that no two Regexps in the list both match s.
Now say that I want a meta regular expression m that is all the
Regexps merged together so that the following pseudo code wroks,
m =3D MetaRegExp.new
for each r { m.add(r) } # add makes sure that no two RegExps
would match the same input
m =3D~ s # returns an int representing which of the n original RegExps
would have matched
Any ideas? Is this possible? If not I will have to code it in C and I
would have to code the RegExp stuff from scratch, which fills me with
fear...
Thanks in advance,
Anthony
(I hope I have explained myself clearly)
I've got a tricky puzzle.
Imagine I have a bunch of n RegExps r[] - they could be any valid ruby Rege=
xps.
Say I want to match each of them in turn to a certain something s to
make sure that no two Regexps in the list both match s.
Now say that I want a meta regular expression m that is all the
Regexps merged together so that the following pseudo code wroks,
m =3D MetaRegExp.new
for each r { m.add(r) } # add makes sure that no two RegExps
would match the same input
m =3D~ s # returns an int representing which of the n original RegExps
would have matched
Any ideas? Is this possible? If not I will have to code it in C and I
would have to code the RegExp stuff from scratch, which fills me with
fear...
Thanks in advance,
Anthony
(I hope I have explained myself clearly)