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
/
("example\.com)\/(reviews|used-cars)\/(.*[^\/$])(\/?)(" )
/
gm
Input 1
1
New
<a href="example.com/reviews/audi/a6/" class="button">Link with other attr</a> <a href="example.com/reviews/audi/a6/">Link without other attr</a>
Substitution
$1/$3/$2/$5
<a href="example.com/reviews/audi/a6/" class="button">Link with other attr</a> <a href="example.com/reviews/audi/a6/">Link without other attr</a>