php - Select malformed URLs in MySQL -


i trying select users internet website url malformed.

i need to:

  1. not select empty "internet" fields

  2. 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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -