This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://www.codeproject.com/Tips/216238/Regular-Expression-to-Validate-File-Path-and-Exten?msg=5202231#xx5202231xx | |
//Credit Bryian Tan 2012 | |
^(?:[\w]\:|\\)(\\[a-z_\-\s0-9\.]+)+\.(txt|gif|pdf|doc|docx|xls|xlsx)$ | |
//Adapted and expanded variations | |
//Added capital letters | |
(?:[\w]\:|\\)(\\[A-Za-z_\-\s0-9\.]+)+\.(txt|gif|pdf|doc|docx|xls|xlsx) | |
//Adapted to forward slashes and added capital letters to match | |
(?:[\w]\:|\/)(\/[A-Za-z_\-\s0-9\.]+)+\.(txt|gif|pdf|doc|docx|xls|xlsx) |