2

I want to validate an url with angular.

I found this : URL validation. ng-pattern not working

So I used :

 ^((https?|ftp)://)?([A-Za-z]+\\.)?[A-Za-z0-9-]+(\\.[a-zA-Z]{1,4}){1,2}(/.*\\?.*)?$

It's work great for this exemple :

http://www.mywebsite.com

But it doesn't work for this complete kind of url :

http://www.mywebsite.com/blog/1

Community
  • 1
  • 1
Xero
  • 3,951
  • 4
  • 41
  • 73

0 Answers0