I had the following url validation regex:
/(ftp|https?)://[^ "]+$/
This is from the ref: Regular expression for URL validation (in JavaScript)
This works fine including cases like http://localhost:8080
, but it also validates the below ones that i dont want. The above regex should not pass the below urls
1. http://www.example..com
2. http://.com
3. http://.
4. http://www.example.
Kindly help as am a noob in regex
Second question, though not related to the question but regex is, when i validate null and undefined against the regex /^[a-z]+$/i i get true. Is this the default behavior or am i missing something over here?