URL with Any Protocol
beginnerMatches URLs with any protocol scheme (http, https, ftp, mailto, etc.).
urluriprotocolweb
Pattern
/[a-zA-Z][a-zA-Z0-9+.-]*://[^\s]+/gTry 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
| Language | Support |
|---|---|
| JS | Full support |
| PYTHON | Full support |
| JAVA | Full support |
| PHP | Full support |
| GO | Full 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);