- The first Regular Expression Library on the Web!

Please support RegExLib Sponsors


Regular Expression Details

Title Test Find Full Windows Folder Drive Path
Validates the format of a Windows folder path ending with a backslash using the drive path--without using lookaround.<br><br>Windows folder drive path components: <br>(I) The drive can only be one letter. <br>(II) The folder and subfolder names (without the drive) (1) Can contain any character except ones with an ASCII code in the range of 0 (x00) through 31 (x1F) and the following: " * / : ? | < > \ (Reference: (2) Cannot begin or end with a space or period.
d:\, E:\reference\h101\
j:ohn\, \\Dpk\, G:\GD, \\cae\.. ..\, \\be\projects$\Wield\Rff\, \\Dpk\T c\
Author Rating: Not yet rated. John Marshall
Your Rating
Bad Good

Enter New Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Paths only, great
Name: Tom Derks
Date: 6/5/2014 6:30:56 AM
I was playing with an regex to check if a user entered a correct filepath. This path is needed by a python script to prepare archived documents. My old regex accepted some silly mistakes like c:\\. As i could not find the flaw i searched for a better one. But most regular expressions i found where to check a complete path inclusive the files. This regex checks only the folder path and is exactly what i need.

Copyright © 2001-2018, | ASP.NET Tutorials