I need following URL should be returned as true
- http://some.url
- http://other.some.url
- http://other.some.url/page/1
- http://some.url/page/1
- https://some.url
- https://other.some.url
- https://some.url/page/1
- other.some.url
- some.url
- some.url/page/1
Following url should be returned as false
- http://some.url/test?id=something
- http://some.url/test?id=something&value=somethingelse
- somerandomvalue
This is regex I tried so far /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/. Im using this inside angular form input ng-patter
Any help would be appreciated
/([a-z0-9_\-]{1,5}:\/\/)?(([a-z0-9_\-]{1,}):([a-z0-9_\-]{1,})\@)?((www\.)|([a-z0-9_\-]{1,}\.)+)?([a-z0-9_\-]{3,})(\.[a-z]{2,4})(\/([a-z0-9_\-]{1,}\/)+)?([a-z0-9_\-]{1,})?(\.[a-z]{2,})?(([\?\&][a-z0-9_\-]{1,}\=[a-z0-9_\-]{1,})+)?/gi