Regular Expression AND mach

chaica chenet.carl at free.fr
Fri Mar 19 17:39:32 CET 2004


On Fri, 19 Mar 2004 07:21:09 -0800, Fuzzyman wrote:

> I'm writing a song lyric database (effectively to drive a projector -
> so the database contains the full song lyrics).
> 
> I'm using a nice simple Python database called KirbyBase which uses
> regular expressions to search.
> 
> A simple search for a phrase I can handle - I think I can even build a
> regular expression that ignores punctuation :-) - but I'm struggling
> with implementing an expression that will find several words
> independently (i.e. a basic 'search engine').
> 
> What I'd like is a reg. exp. that will match if a field contains word
> 1 *and* word 2 *and* word 3...... (for example) - but in no particular
> order......
> 
> Can anyone offer any clues (ideally without me having to index every
> song seperately from the database - which would kind of defeat the
> object)...
> 
> Regards,
> 
> 
> Fuzzyman


To realize and test your regexs, use kodos. Very good python regex
debugger.
http://kodos.sourceforge.net/

Regards,



More information about the Python-list mailing list