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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details Pattern Title
Expression
^((?<DRIVE>[a-z]:)|(\\\\(?<SERVER>[0-9]*[a-z\-][a-z0-9\-]*)\\(?<VOLUME>[^\.\x01-\x1F\\""\*\?<>:|\\/][^\x01-\x1F\\""\*\?|><:\\/]*)))?(?<FOLDERS>(?<FOLDER1>(\.|(\.\.)|([^\.\x01-\x1F\\""\*\?|><:\\/][^\x01-\x1F\\""\*\?<>:|\\/]*)))?(?<FOLDERm>[\\/](\.|(\.\.)|([^\.\x01-\x1F\\""\*\?|><:\\/][^\x01-\x1F\\""\*\?<>:|\\/]*)))*)?[\\/]?$
Description
Verify "well formed-ness" of DOS or UNC paths. Passed over 170 NUnit test, (took 3 complete rewrites) Components of a path: DRIVE:=[a-z]: SERVER:=[0-9]*[a-z\-][a-z0-9\-]* FNAME:=[^\.\x01-\x1F\\""\*\?<>:|\\/][^\x01-\x1F\\""\*\?<>:|\\/]* VOLUME:=FNAME UNC:=\\SERVER\VOLUME ROOT:=(DRIVE|UNC) FOLDER:=.|..|FNAME FOLDERS:=FOLDER?([\]FOLDER)*[\]? PATH:=^ROOT?FOLDERS?$
Matches
his is a very 'long' folder\that is.part of 2 folders. | b\c\..\x. | \\Dads\Mp3\FileName1\.\TestDir2
Non-Matches
\\1.dads\C | \. folder\ | .ext
Author Rating: Not yet rated. Tristen Fielding
   Displaying page 1 of 1 pages; Items 1 to 1

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