Regular Expressions 101

Community Patterns

Parse out a URL for optional values

0

Regular Expression
ECMAScript (JavaScript)

/
(([\W\w]*)(apps)(-?)([\w]{0,2})(.[\W\w]*))
/

Description

Tokenize a HostName for optional string values. Good for testing whether you are in np, qa, qp, or production environments.

Submitted by Matthew Ledbetter - 8 years ago