URL Validation REGEX - URL just valid with http://

后端 未结 5 1150
梦谈多话
梦谈多话 2020-12-14 17:50

How it works

I have an input field to enter the URL of a Website and i wanna check it and if the URL is OK i will give the inputfield a class(\"vali

5条回答
  •  醉话见心
    2020-12-14 18:38

    Shorter way:

    (\w*\W*)?\w*(\.(\w)+)+(\W\d+)?(\/\w*(\W*\w)*)*
    

    You can test it in this wonderful regex editor: https://regex101.com/

提交回复
热议问题