Regular Expressions 101

Community Patterns

Full URI Mapping

2

Regular Expression
PCRE (PHP <7.3)

/
(?:([^\:]*)\:\/\/)?(?:([^\:\@]*)(?:\:([^\@]*))?\@)?(?:([^\/\:]*)\.(?=[^\.\/\:]*\.[^\.\/\:]*))?([^\.\/\:]*)(?:\.([^\/\.\:]*))?(?:\:([0-9]*))?(\/[^\?#]*(?=.*?\/)\/)?([^\?#]*)?(?:\?([^#]*))?(?:#(.*))?
/
gm

Description

Everything, including proto, user:pass, host, query params and anchors

Submitted by baadf00d - 9 years ago