Why no RE match of A AND B?

Anders J. Munch andersjm at dancontrol.dk
Tue Mar 4 07:47:21 EST 2003


"Tim Peters" <tim.one at comcast.net> wrote:
> RL intersection *is* routinely implemented in finite-state machine packages.
> For example, see
> 
>     http://www.research.att.com/~mohri/fsm/
> 
> and that package's fsmintersect program.  I can think of very few plausible
> use cases for it in string-matching, though ("it's a Sunday and a Thursday"
> or "it's an identifier and it's a number" make less sense than "it's a floor
> wax and a dessert topping"), and in this respect it's relevant that common
> notations for grammar specification (like EBNF) don't bother with an
> intersection operator either.

It's useful in combination with complement ("it's a .*day but not a
Sunday").

But then complement is probably too spooky for most people.

- Anders






More information about the Python-list mailing list