Why no RE match of A AND B?
reply.in at the.newsgroup
Mon Mar 3 01:26:35 CET 2003
Anders J. Munch:
>"Rene Pijlman" <reply.in at the.newsgroup> wrote:
>> I take it this means:
>> match(r1&r2,s) <==> match(r1,s) and match(r2,s)
>> I assume (without a formal prove at this point) that r1&r2 can
>> always be reformulated as a simpler expression, BIMBW.
>It can always be reformulated as an expression without an intersection
>('&') operator. But not necessarily a simpler one.
Could you give an example?
But I May Be Wrong :-)
>I've never understood either why the intersection operator is usually
>missing from regular expression implementations. Tradition?
The Dragon Book seems to take it for granted. It's not even an
There's a whole body of theory built on the concept of regular
expressions, including formal language theory, finite state
automata and computational complexity. All of that may have to
be redesigned to accomodate the intersection in regular
expressions. I dunno, but if it aint broken... :-)
More information about the Python-list