Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
(?<id>^\d+)((?:\|type=(?<type>\w+))|(?:\|order=(?<order>\w+))){0,2}
/
gm
Input 1
1
New
1 1|order=asc|type=1 1|type=1|order=asc 1|type=1|type=2 1|type=1|type=2|order=asc
Extraction
1 1|order=asc|type=1 1|type=1|order=asc 1|type=1|type=2 1|type=1|type=2|order=asc