Regular Expressions 101

Search for URL

Open Workspace
  • PCRE2 (PHP)
  • Match
0

Regular Expression

/
(https:\/\/|http:\/\/).+\..+\/|(http\:\/\/|)localhost(\:(\d+$))
/
gmU

Description

Searches the string for valid URLs. Includes HTTP, HTTPS, and localhost with it's port.

Submitted by Evan Wilson