Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
^#(\/.*?)(\?.*)?$
/
gm

Description

Example:

input: #/articles?page=1&show=published&by=updated&start=newest&preview=true

output:

0: "#/articles?page=1&show=published&by=updated&start=newest&preview=true"

1: "/articles"

2: "?page=1&show=published&by=updated&start=newest&preview=true"

Submitted by oklookat - 3 years ago