Regex Tester for URL Validation
Your data never leaves your browserURL validation is deceptively complex. Test against edge cases.
Example
Pattern: ^https?://[\\w.-]+(?:/[\\w./-]*)?$\n\nTest: https://example.com, not-a-url
Tips
- 1RFC 3986 is very permissive.
- 2Use new URL() for reliable JS validation.
- 3Capture groups for parts.
Frequently Asked Questions
Best URL regex?
^https?://[^\\s]+$ for practical use.
Regex or URL API?
URL API for production.
Non-ASCII?
Match broader ranges.