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
r"
(?:(?!/)[\S])*-(?:(?!/)[\S])*
"
gm
Input 1
New
>>> string_1 = 'variety.com/2017/biz/news/tax-march-donald-trump-protest-1202031487/' >>> string_2 = 'variety.com/2017/biz/the/life/of/madam/green/news/tax-march-donald-trump-protest-1202031487/' >>> string_3 = 'variety.com/2017/biz/the/life/of/news/tax-march-donald-trump-protest-1202031487/the/days/of/our/lives' Desire
Extraction
>>> string_1 = 'variety.com/2017/biz/news/tax-march-donald-trump-protest-1202031487/' >>> string_2 = 'variety.com/2017/biz/the/life/of/madam/green/news/tax-march-donald-trump-protest-1202031487/' >>> string_3 = 'variety.com/2017/biz/the/life/of/news/tax-march-donald-trump-protest-1202031487/the/days/of/our/lives' Desire