Title |
Test
Find
valid file path pattern
|
Expression |
^(([a-zA-Z]:)|((\\|/){1,2}\w+)\$?)((\\|/)(\w[\w ]*.*))+\.([a-zA-Z0-9]+)$ |
Description |
Matches file paths to any valid format. Matches both "\" and "/" as valid separators in file path. Extension ("[a-zA-Z0-9]+") can be changed to any specific extension like (txt|jpg|png) and so on.Does NOT match relative file paths.
Feel free to write any comments about bugs or anything, since this is my first contribution to regexlib |
Matches |
/asdjd/jhsdh.ajsd | E:\drive.txt | \\usr\home\docs.jpg | \users\assassin\home/yp.r15 |
Non-Matches |
//home/boo/ | foo/bar.bmp |
Author |
Rating:
Abhishek Kale
|
Source |
|
Your Rating |
|
Title: error
Name: manshi
Date: 5/24/2016 9:06:00 AM
Comment:
not running in java error illigal escape sequence