Enumerating Regular Expressions

James Stroud jstroud at ucla.edu
Tue May 9 00:51:39 EDT 2006


blair.bethwaite at gmail.com wrote:
> James Stroud wrote:
> 
>>You mean like re.compile(r'.*') ?
> 
> 
> No.  I mean like:
> 
>>>>regex = re.compile(r'a|b')
>>>>regex.enumerate()
> 
> a
> b
> 
> 

You see the difficulty don't you? How will the computer know in advance 
that the regex matches only a finite set of possible strings?

James

-- 
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/



More information about the Python-list mailing list