shortest match regexp operator anyone?
Harald Kirsch
kirschh at lionbioscience.com
Thu Jul 12 02:46:39 EDT 2001
ejeandel at ens-lyon.fr (Emmanuel Jeandel) writes:
> > 1) It doesn't solve the intellectual challenge.
>
> What about : ([^<]|(<+(A<+)*([^A<]|(A[^<>]))))*<+(A<+)*A>B ?
Woow, seems to work. Did you fiddle around long enough by hand or is
it the result of a formal construction? In the latter case it should
be easy to write a script which, given a string s, results in a regexp
matching t s where t does not include s.
>From the construction I expect the resulting regexp to have a length
of O(2^len(s)).
Harald.
--
----------------+------------------------------------------------------
Harald Kirsch | kirschh at lionbioscience.com | "How old is the epsilon?"
LION bioscience | +49 6221 4038 172 | -- Paul Erdös
*** Please do not send me copies of your posts. ***
More information about the Python-list
mailing list