URL regular expressions can be used to verify if a string has a valid URL format as well as to extract an URL from a string.
HTTP and HTTPS URLs that start with protocol can be validated using the following regular expression
True
False
Enter a text in the input above to see the result
Example code in Javascript:
The regular expression to validate URL without protocol is very similar:
True
False
Enter a text in the input above to see the result
Example code in Javascript:
True
False
Enter a text in the input above to see the result
The above-mentioned regular expressions only cover the most commonly used types of URLs with domain names. If you have some more complex cases you might need a different solution.
Discover UI Bakery – an intuitive visual internal tools builder.