Regular Expression AND mach

Fuzzyman michael at foord.net
Fri Mar 19 10:21:09 EST 2004


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

--

http://www.voidspace.org.uk/atlantibots/pythonutils.html



More information about the Python-list mailing list