Hi,
Seems to work! But the number is a zero you have to add an extra escape:
(\\0+\3+\\0+\9+)
or you get ERROR 1139 (42000): Got error 'parentheses not balanced' from regexp
Thank you!!
Paul
----- Original Message ----
From: "Bartis, Robert M (Bob)" <bartis@stripped>
To: Paul Nowosielski <paulnowosielski@stripped>; mysql@stripped
Sent: Monday, December 1, 2008 6:42:19 PM
Subject: RE: regular expressions matching only numeric characters in order
Hi
I am a bit of novice at Regexp, but I believe this will work for you
(\d+\d+\d+).*(\d+\d+\d+).*(\d+\d+\d+\d+)
Robert M. Bartis
EMAIL: bartis@stripped
-----Original Message-----
From: Paul Nowosielski [mailto:paulnowosielski@stripped]
Sent: Monday, December 01, 2008 3:32 AM
To: mysql@stripped
Subject: regular expressions matching only numeric characters in order
Dear All,
I'm trying to create a regular expression query to match phone numbers
in a database field.
My issue is this , the numbers have no set standard for input in the db.
So the number in the db could be in multiple formats.
EX:
333.333.3333
(333)333-3333
333-333-3333
3333333333
So I am wanting to find matches and ignore any non-numeric values and
need some help with the expression.
The query would be something like:
SELECT tel FROM leads WHERE do_not_call = '1' AND tel REGEXP 'the
expression'
The number I am looking for will already have all the non numerics
stripped and will be in the format of nnnnnnnnnn.
Any help would be appreciated.
Thank you,
Paul
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=1