I have this Regex to Check for a valid Windows Disk path.
^[a-z]:\\?(?:[^\\/:*?""<>|\r\n]+\\)*[^\\/:*?""<>|\r\n]*(?:[^./:*?""<>])$
Here I am giving this last part so that we do not allow Ending with Decimal and Special Characters like it should not be like "d:\abc\def."
(?:[^./:*?""<>])
But now it is allowing a dot in the middle somewhere like
d:\sdsd.\
and not taking
d:
NOTE: I had picked this original Regex from somewhere on the internet.
@"^[a-z]:\\(?:[^\\/:*?""<>|\r\n]+\\)*[^\\/:*?""<>|\r\n]*$"