David Smith

David Smith

  • NA
  • 2k
  • 0

Regex validation for relative paths

Aug 9 2013 4:10 AM
Below I am using this regex below to validate relative paths. The regex string below do not accept this as a valid path. Can someone help me.

"..\\..\\Bin\\Example.xml"  Error, not recognized as a path according to the regex below.



string regExp = @"^(?:[A-Za-z]\:|\\)(\\[a-zA-Z_\-\s0-9\.]+)+(\.\w+)?$";

Answers (11)