shank8 Posted April 15, 2012 Report Share Posted April 15, 2012 I need to create a function that has a VARCHAR as a parameter and checks to see if there is a match of that VARCHAR to a VARCHAR in a table. However, the VARCHAR is a phone number and I am supposed to have my function accept strings like '555-555-5555' and '555.555.5555' and '(555) 555-5555' when the number in the table has the format '5555555555'. Therefore, how can I use REGEXP or some other function or algorithm in mySQL that can handle the extra characters? Is it even possible to use REGEXP in this case? Thank you Link to comment Share on other sites More sharing options...
justsomeguy Posted April 16, 2012 Report Share Posted April 16, 2012 Check the list of string functions to see what is available: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html There's also a set of user-defined functions that includes an implementation of a regular expression replace: https://launchpad.net/mysql-udf-regexp Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now