Wednesday 15 May 2013

mysql - REGEX for NOT matching phone number -



mysql - REGEX for NOT matching phone number -

im trying match doesn't match phone number format of ###-###-####

i have find string of 10 digits

select id, cust_num `leads` cust_num regexp '[0-9]{10}'

this finds 10 digits long. thats been far finding entries typed string of digits number,

however want find doesnt match format.

555-555-5555

so want find , don't match above format

/* example, should find these*/ 5555555555 555 555 5555 (555)5555555 555-555-555 (555)-555-5555

what right regex find not match ###-###-####

thanks

select id, cust_num `leads` cust_num not regexp '[0-9]{3}-[0-9]{3}-[0-9]{4}'

should it.

mysql regex phone

No comments:

Post a Comment