Regular Expressions 101

Community Patterns

My first regex pattern of url(http,https,ftp,sftp,ftps)

1

Regular Expression
PCRE (PHP <7.3)

/
^(?<protocol>((https?)|(sftp)|(ftps?):))?(\/\/)?(?<domain>([a-zA-Z0-9\._-]+))+(?<path>([\/\w.]+))*(\?{0,1})(?<parameters>([&|&amp;]*([\w\.,-]*=*[\w\.,-]*)))*$
/

Description

no description available

Submitted by Naruto(Kenny Fan) - 8 years ago