Password in URL
beginnerDetects credentials embedded in URLs.
securitypasswordurlscanning
Pattern
/(?:https?|ftp)://[^:@/\s]+:[^:@/\s]+@/giTry It
0 of 5 strings matched
Explanation
Matches URLs containing user:password@ authentication. This is a security anti-pattern as credentials may be logged in plaintext.
Test Strings
Matching
- https://user:pass@example.com
- ftp://admin:secret@files.server.com
Non-matching
- https://example.com
- https://user@example.com
- user:pass@host
Language Compatibility
| Language | Support |
|---|---|
| JS | Full support |
| PYTHON | Full support |
| JAVA | Full support |
| PHP | Full support |
| GO | Full support |
Code Snippets
const regex = /(?:https?|ftp):\/\/[^:@\/\s]+:[^:@\/\s]+@/gi;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);