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
/
^\/foo\/([^\/]+)$
/
m
Input 1
// Take this string: /foo/bar // which should be applied to: /foo/? // where the question mark means required parameter. So the following should be correct: /foo/bar and the following should be wrong: /foo /foo/ /foo/bar/abc
Substitution
// Take this string: /foo/bar // which should be applied to: /foo/? // where the question mark means required parameter. So the following should be correct: /foo/bar and the following should be wrong: /foo /foo/ /foo/bar/abc