Skip to main content
Regexflux

URL with Any Protocol

beginner

Matches URLs with any protocol scheme (http, https, ftp, mailto, etc.).

urluriprotocolweb

Pattern

/[a-zA-Z][a-zA-Z0-9+.-]*://[^\s]+/g

Try It

0 of 6 strings matched

Explanation

Matches any valid URI scheme (starts with a letter, followed by letters, digits, +, ., or -) then :// and one or more non-whitespace characters.

Test Strings

Matching

  • https://example.com
  • ftp://files.server.com/doc.pdf
  • ssh://git@github.com

Non-matching

  • ://missing.com
  • 123://invalid.com
  • no-protocol.com

Language Compatibility

LanguageSupport
JSFull support
PYTHONFull support
JAVAFull support
PHPFull support
GOFull support

Code Snippets

const regex = /[a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^\s]+/g;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);

Related Patterns