time-to-botec/js/node_modules/@stdlib/regexp/extended-length-path/README.md
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

2.1 KiB

Extended Length Path

Regular expression to detect an extended-length path.

Usage

var reExtendedLengthPath = require( '@stdlib/regexp/extended-length-path' );

reExtendedLengthPath()

Returns a regular expression to detect an extended-length path (i.e., a Windows path which begins with the characters \\?\).

var RE = reExtendedLengthPath();
var bool = RE.test( '\\\\?\\C:\\foo\\bar' );
// returns true

Examples

var reExtendedLengthPath = require( '@stdlib/regexp/extended-length-path' );

var RE_EXTENDED_LENGTH_PATH = reExtendedLengthPath();
var bool;
var path;

path = '\\\\?\\C:\\foo\\bar';
bool = RE_EXTENDED_LENGTH_PATH.test( path );
// returns true

path = '\\\\?\\UNC\\server\\share';
bool = RE_EXTENDED_LENGTH_PATH.test( path );
// returns true

path = 'C:\\foo\\bar';
bool = RE_EXTENDED_LENGTH_PATH.test( path );
// returns false

path = '/c/foo/bar';
bool = RE_EXTENDED_LENGTH_PATH.test( path );
// returns false

path = '/foo/bar';
bool = RE_EXTENDED_LENGTH_PATH.test( path );
// returns false