Regex Tester for URL Validation

Your data never leaves your browser

URL validation is deceptively complex. Test against edge cases.

Example

Pattern: ^https?://[\\w.-]+(?:/[\\w./-]*)?$\n\nTest: https://example.com, not-a-url

Tips

  1. 1RFC 3986 is very permissive.
  2. 2Use new URL() for reliable JS validation.
  3. 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.