Problem with using a regular expression (or even a simple wildcard search) is that they are very slow. I have looked for a better solution to search through a mysql database but didn't find anything that worked great with mysql. If speed is important then you are pretty much out of luck without upgrading to mysql 4.0 (if you find something please share it with the list =) ).
It is pretty easy to convert something like "tty*" to a query, however... select * from table1 where field1 LIKE 'tty%' will do it... albiet slowly. You can change the where clause to do more stuff like "where field1 LIKE 'tty%' OR field1 like 'something else'" but this definitly would be slow. There are probably better ways of doing something like this that I dont know off of the top of my head. Good luck, ryan ----- Original Message ----- From: "Eric Mayers" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 10, 2002 5:14 PM Subject: Best text query implementation? Hi Everbody, I'd like to know how people are forming text searches with MySQL. I'd like to be able to support a query something like: (login AND root) OR ("invalid login" AND tty*) a code snippet that could turn a query like this into a MySQL Regular expression or other query of some kind would be ideal. I'm not able to use MySQL 4.0.1 FULLTEXT binary mode searches because I can't use alpha code at this point. Thanks, Eric Mayers Software Engineer Captus Networks --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php