RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Valid directory only path
Expression
([A-Z]:\\[^/:\*;\/\:\?<>\|]+)|(\\{2}[^/:\*;\/\:\?<>\|]+)
Description
This regex will validate whether the value is a valid directory path.
Matches
C:\ValidFolder C:\ValidFolder\SubFolder \\ValidShare \\ValidShare\Subfolder
Non-Matches
C:\Inval:idPath InvalidFolder\Subfolder D:\Invalid*Folder
Author Rating: The rating for this expression. Craig Prescott
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

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: Wrong
Name: Felipe Souza
Date: 6/15/2016 5:48:38 PM
Comment:
It validates absolute paths like: \\path\test.txt


Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials