Oh, I think I know this one.

Copied from my console:

mysql> select * from test;
+----+---------+
| id | myvalue |
+----+---------+
|  1 |      12 |
|  2 |      15 |
|  3 |       3 |
|  4 |      10 |
|  5 |      10 |
|  6 |      10 |
+----+---------+
6 rows in set (0.04 sec)

mysql> select * from test where myvalue = REPLACE('-1-2-','-','');
+----+---------+
| id | myvalue |
+----+---------+
|  1 |      12 |
+----+---------+
1 row in set (0.06 sec)

In this example, the user did a search for '-1-2-' and I told mysql to give me all records that equaled the result of the replace function that replaced all '-' with nothing. So it matched 12 from the user input -1-2-.

If that works for you, let me know.

bob




Luke Majewski wrote:

Hi everyone,

ok, so I know how to use RLIKE to match regular expressions. However, let's say I have an isbn number of:

0-06-430022-6

saved in the database but someone wants to search for it by entering:

0064300226

or even

006-430-0226



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to