Title |
Test
Find
Regular Expression to validate file path and extension
|
Expression |
^(?:[\w]\:|\\)(\\[a-z_\-\s0-9\.]+)+\.(txt|gif|pdf|doc|docx|xls|xlsx)$ |
Description |
Regular Expression to validate file path and extension.Compatible with JavaScript and ASP.NET |
Matches |
\\192.168.0.1\folder\file.pdf | \\192.168.0.1\my folder\folder.2\file.gif | c:\my folder\abc abc.docx | c:\my-folder\another_folder\abc.v2.docx |
Non-Matches |
\\192.168.0.1\folder\fi/le.pdf | \\192.168.0.1\folder\\file.pdf | \\192.168.0.1\my folder\folder.2\.gif | c:\my folder\another_folder\.docx | c:\my folder\\another_folder\abc.docx | c:\my folder\another_folder\ab*c.v2.docx | c:\my?folder\another_folder\abc.v2.docx | file.xls |
Author |
Rating:
Bryian Tan
|
Source |
|
Your Rating |
|