Guys I have tried so many crazy Regex none worked to check something like this =>> C:\Blabla\Blabla\Blabla\Blabla\blabla.txt or ANY level of file depth meaning C:\Blabla\Blabla\Blabla\Blabla\Blabla\Blabla\Blabla\Blabla\Blabla\Blabla\blabla\blablablabla.txt
I mean this pattern. No server patterns.
Regex.IsMatch (MyPath, @"^(?:[a-zA-Z]\:|\\\\[\w\.]+\\[\w.$]+)\\(?:[\w]+\\)*\w([\w.])+$")

Munesh SharmaRank #174 · 13.9K reputationPosted Dec 1, 2015, 7:04 PM EST
Bouzid Aissaoui5 reputationPosted Dec 2, 2015, 9:06 AM EST