php - Select malformed URLs in MySQL -
i trying select users internet website url malformed.
i need to:
not select empty "internet" fields
select "internet" fields url malformed.
i have entered 1 malformed url - www.te st.com - space in between, use test. tried query result list blank.
$sql = "select * calendario `internet` not regexp '^(https?:\/\/|www\.)[\.a-za-z0-9\-]+\.[a-za-z]{2,4}' , `internet` !='' order data desc";
does know wrong mysql url validation?
.
meta-character should escaped double quote \\.
or placed character class [.]
the following query should work expected:
select * calendario `internet` not regexp '^(https?:\/\/|www\\.)[-.a-za-z0-9]+\\.[a-za-z]{2,4}' , `internet` !='' order data desc
Comments
Post a Comment