Displaying page
of
pages;
Items to
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
of
pages;
Items to