1 # unc-path-regex [![NPM version](https://badge.fury.io/js/unc-path-regex.svg)](http://badge.fury.io/js/unc-path-regex) [![Build Status](https://travis-ci.org/jonschlinkert/unc-path-regex.svg)](https://travis-ci.org/jonschlinkert/unc-path-regex)
3 > Regular expression for testing if a file path is a windows UNC file path. Can also be used as a component of another regexp via the `.source` property.
5 Visit the MSDN reference for [Common Data Types 2.2.57 UNC](https://msdn.microsoft.com/en-us/library/gg465305.aspx) for more information about UNC paths.
9 Install with [npm](https://www.npmjs.com/)
12 $ npm i unc-path-regex --save
18 // unc-path-regex returns a function
19 var regex = require('unc-path-regex')();
24 Returns true for windows UNC paths:
27 regex.test('\\/foo/bar');
28 regex.test('\\\\foo/bar');
29 regex.test('\\\\foo\\admin$');
30 regex.test('\\\\foo\\admin$\\system32');
31 regex.test('\\\\foo\\temp');
32 regex.test('\\\\/foo/bar');
33 regex.test('\\\\\\/foo/bar');
38 Returns false for non-UNC paths:
41 regex.test('/foo/bar');
48 regex.test('c:./file');
50 regex.test('c:/file');
55 * [dotfile-regex](https://github.com/regexps/dotfile-regex): Regular expresson for matching dotfiles.
56 * [dotdir-regex](https://github.com/regexps/dotdir-regex): Regex for matching dot-directories, like `.git/`
57 * [dirname-regex](https://github.com/regexps/dirname-regex): Regular expression for matching the directory part of a file path.
58 * [is-unc-path](https://github.com/jonschlinkert/is-unc-path): Returns true if a filepath is a windows UNC file path.
59 * [is-glob](https://github.com/jonschlinkert/is-glob): Returns `true` if the given string looks like a glob pattern.
60 * [path-regex](https://github.com/regexps/path-regex): Regular expression for matching the parts of a file path.
64 Install dev dependencies:
67 $ npm i -d && npm test
72 Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/unc-path-regex/issues/new)
78 + [github/jonschlinkert](https://github.com/jonschlinkert)
79 + [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
83 Copyright © 2015 Jon Schlinkert
84 Released under the MIT license.
88 _This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 07, 2015._