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"
^ (?P<uri>file://)? (?P<path>(?:/?[A-Z]{1}:)? # start of path capture, optional windows top-level directory [\\/]? # optional start separator (?:[-. \w]+[\\/])+) # path (?P<filename>\.?[^.\n]+?(?=\.(?P<extension>.+$)|$))?
"
gxm
Input 1
New
/foo/bar.txt /foo/bar/ /foo/makefile ./foo.txt /foo/._bar.txt /foo/_bar.bar.txt foo/bar.txt D:\foo\bar.m3u file:///var/www/html/index.html file:///C:/users/me/My Documents/index.html /var/foo/bar.tar.gz
Substitution
/foo/bar.txt /foo/bar/ /foo/makefile ./foo.txt /foo/._bar.txt /foo/_bar.bar.txt foo/bar.txt D:\foo\bar.m3u file:///var/www/html/index.html file:///C:/users/me/My Documents/index.html /var/foo/bar.tar.gz