Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
@
(?<!\w)(?:http://www\.example\.com)?/(\S+?)\.pdf\b
@
ig
Input 1
1
New
some containing string http://www.example.com/subfolder/name.pdf or /subfolder/name.pdf <a href="/pdf/subdir/name.pdf">clickhere</a><a href="/pdf/subdir/name.pdf">2nd PDF</a>
Substitution
/wp-content/uploads/old/$1.pdf