Why no RE match of A AND B?

Erik Max Francis max at alcyone.com
Sun Mar 2 19:58:37 EST 2003


Rene Pijlman wrote:

> But OTOH there are notational shortcuts in the usual RE
> languages. For example:
> 
>    a+ == aa*
>    r{3,5} == rrrr?r?
> 
> So what makes the intersection different?

Probably frequency of use and utility.  I can't think of a single case
in my long history of usage of regular expressions (both simple and
extended) where an intersection would have been useful (and warranted as
opposed to just writing out what that was equivalent to without
intersections).  (In fact, it wasn't entirely clear to me what the
original poster intended with his & operator, which is why I withheld
comment until others had made their guesses.)

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ All the people in her neighborhood turn around and get mad and sing
\__/ Public Enemy
    CSBuddy / http://www.alcyone.com/pyos/csbuddy/
 A Counter-Strike server log file monitor in Python.




More information about the Python-list mailing list