Re: pattern matching - but in reverse

2004-07-03 Thread Michael Dykman
I take it this is the back end for a web application of some kind. removing the dashes before the insert with the procedural language should be trivial. What language is on the front end of this? Creating a regular expression which would match dashed or non-dashed number would not be that hard

Re: pattern matching - but in reverse

2004-06-20 Thread Bob Ramsey
Whoops. I was thinking about how I have my isbn table stored. ;) I prefer to remove all formatting from numbers like this(isbn, phone numbers, social security numbers, etc) before storing them. Anyway, here's something that should work. I'm not sure if it is the most efficient way to do thi

Re: pattern matching - but in reverse

2004-06-20 Thread Luke Majewski
Hi Bob, I think this might be in the wrong direction - my isbn is saved with the dashes, so I would need it to look like: select * from test where REPLACE('myvalue','-','') = '12'; which I'm not sure will work. When I get on my machine I'll give some variations of this a try, thanks for the qui

Re: pattern matching - but in reverse

2004-06-20 Thread Bob Ramsey
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 tes

pattern matching - but in reverse

2004-06-20 Thread Luke Majewski
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 So the search query needs to have its dashes removed