word search

A

Andrea Cova

Hi,
i'm trying to write a program that finds single words that works like this:
i'd like to find a word, the exact word, without making mistakes like, when
i'm looking for 'cow', he tells me he found it in 'coward'.
I have an idea how to do this in C, but i guess it would be less complicate
in python.
The findall() function would be ok, but i need to make some modifications
like this one:
I want the program to find matches only when the word isn't in the middle
of other letters. Other kinds of chars instead are accepted. (for instance:
' cow ', '_cow_', '(cow)',' -cow, ' are right matches).


I need this for a program that does the following: i've got a list of song
titles, saved in a txt file for example, and a list of filenames in a
directory (mp3 files), and for each song title i want to find the best
match in the filenames.
Then when all the matches are done I modify the mp3 files' tags according
to the information in the txt file.
I know there are windows programs to do this, but they don't have functions
like taking a text list and find the corresponding mp3 on their own.

And two little questions:

1-i read in the manuals that if i want "search()" to ignore the case, i
have to put the flag I. I can't get this to work. Could you write me an
example of how to write this? I
2-how can i make also "findall()" be case UNsensitive?

Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top