Create URL matching patterns for HTTP, HTTPS, FTP

Check whether text resembles a complete web URL.

freeworks offlinenothing uploaded
ToolURL Regex
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

The pattern recognizes a scheme, authority, optional port, path, query, and fragment using a practical URI subset. Full-input anchors are used, but DNS resolution and URL safety checks are not.

  • HTTP and HTTPS cover common web links.
  • A practical subset stays readable compared with the entire URI grammar.

Worked example

HTTPS URL validation pattern
Get the regex pattern for validating HTTPS URLs only
Input
											https
										
Output
												URL Regex (https):

^https:\/\/[^\s/$.?#].[^\s]*$

Matches HTTPS URLs only
											

When to use this

Link forms, crawlers, and Markdown linters check web URLs.

Edge cases

  • Spaces need percent-encoding.
  • Internationalized domains can use Unicode or punycode.
  • A valid URL can still be dead or unsafe.

References