Regular Expressions 101

Community Patterns

SFTP with username and optional port & password

0

Regular Expression
PCRE (PHP <7.3)

/
(?<protocol>s?ftp):\/\/(?<user>[^@\s]+)@(?<host>[^\?\s:]+)(?::(?<port>[0-9]+))?(?:\?(?<password>.+))?
/
gm

Description

no description available

Submitted by anonymous - 10 years ago