Why no RE match of A AND B?

Andrew Koenig ark at research.att.com
Sun Mar 2 19:34:14 EST 2003


Anders> It can always be reformulated as an expression without an
Anders> intersection ('&') operator.  But not necessarily a simpler
Anders> one.

Anders> BIMBW?

Anders> I've never understood either why the intersection operator is usually
Anders> missing from regular expression implementations.  Tradition?

Because in general, the intersection of two regular expressions is not
a regular expression, in the sense that it cannot generally be represented
by a regular grammar or parsed efficiently by a finite automaton.

-- 
Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark




More information about the Python-list mailing list