Regular Expressions 101

Community Patterns

URL Teardown v2

0

Regular Expression
PCRE (PHP <7.3)

/
^(?:(?<protocol>\w*?):\/\/(?<authority>(?<mnemonic>\w*).(?<host>(?<clientid>(?<client>\w*)-?(?<environment>\w*)).(?<domain>[\w-.]*))(?::?(?<port>\d*)))\/(?<path>[\w-]*)\s*$)
/
gm

Description

Adds in teardown of the client id, environment, and domain

Submitted by anonymous - 5 years ago