Regular Expressions 101

Community Patterns

1...34567...901

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