"Craig Ringer" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> On Mon, 2005-01-03 at 08:52, Ross La Haye wrote:
>> How can an and operator be emulated in regular expressions in Python?

Regular expressions are designed to define and detect repetition and 
alternatives.  These are easily implemented with finite state machines. 
REs not meant for conjunction.  'And' can be done but, as I remember, only 
messily and slowly.  The demonstration I once read was definitely 
theoretical, not practical.

Python was designed for and logic (among everything else).  If you want 
practical code, use it.

if match1 and match2: do whatever.

Terry J. Reedy



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to