Hi there!
Yes It seems to be very tricky :-)
I have checked the possibuility to use FULLTEXT search but I use InnoDB tables. That was the only way I could manage foreign keys. I'm not really sure how to rule the strings, one way might be using split funktions, but then I have the problem to find the matching position in the db column, dynamicly identify the position of a possible hyphens so I know where to start and stop. The results can be very odd doing that wrong.
I have checked your link and there was one user comment similar to my problem. The comment is provided below
"
------------------
Hyphen '-' characters break literals at the moment.
A search for something like "GATA-D22S690" finds
all entries containing GATA and not the full
hyphenated text. The '-' character is treated as a
word stop even within literals. The same is true if
any of the special text search modifiers are used
(eg +, -, ~)
so that hyphenated literals are not correctly found with full text searches.
-------------------
"
Yes, you need a function to replace. You can do it in your scripting language or use a MySQL function REPLACE() with in the query.
Where will you put '-' in an input string? Is there any rule? This will be a resource intesive procedure, '-' can be placed in many places in email like
e-mail
em-ail
ema-il
emai-l
If you are providing a search facility, then take a look at FULLTEXT search.