0.1.2 • Published 9 years ago

unc-path-regex v0.1.2

Weekly downloads
3,978,123
License
MIT
Repository
github
Last release
9 years ago

unc-path-regex NPM version Build Status

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.

Visit the MSDN reference for Common Data Types 2.2.57 UNC for more information about UNC paths.

Install

Install with npm

$ npm i unc-path-regex --save

Usage

// unc-path-regex returns a function
var regex = require('unc-path-regex')();

true

Returns true for windows UNC paths:

regex.test('\\/foo/bar');
regex.test('\\\\foo/bar');
regex.test('\\\\foo\\admin$');
regex.test('\\\\foo\\admin$\\system32');
regex.test('\\\\foo\\temp');
regex.test('\\\\/foo/bar');
regex.test('\\\\\\/foo/bar');

false

Returns false for non-UNC paths:

regex.test('/foo/bar');
regex.test('/');
regex.test('/foo');
regex.test('/foo/');
regex.test('c:');
regex.test('c:.');
regex.test('c:./');
regex.test('c:./file');
regex.test('c:/');
regex.test('c:/file');

Related projects

  • dotfile-regex: Regular expresson for matching dotfiles.
  • dotdir-regex: Regex for matching dot-directories, like .git/
  • dirname-regex: Regular expression for matching the directory part of a file path.
  • is-unc-path: Returns true if a filepath is a windows UNC file path.
  • is-glob: Returns true if the given string looks like a glob pattern.
  • path-regex: Regular expression for matching the parts of a file path.

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on July 07, 2015.

is-unc-patheasy-select-rn@arisageha/react-lazyloadairscanairscan-examplereact-native-esc-pos-sahaab@borisovart/atol-kkt-moduledeneme323112@ntt_app/react-native-custom-notificationreact-native-covid-sdkpanqibaoreact-native-printer-brothersreact-native-shekhar-bridge-test@oiti/documentoscopy-react-nativequoc-testunblock-block-save-variables@prodam/prodam-typesluminos-ui-core@everything-registry/sub-chunk-3010jawwy-sdkjawwy_gamification_releasereact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgreact-native-jawwy_samplegriffin-ui-librarytest-library-123test-haptik-libwed_developerwow.js-juzixdms3wifi_configuration_packagetest-zeo-collectvision-camera-plugin-face-detectorvision-camera-plugin-scan-facesvision-camera-base64-resizedvantiq-reactvideo-multi-uploader@ctfdio/picocss-themes@cs6/react-native-test-native-view-library@con-test/react-native-concent-common@dan/cryptocoins-icons@damruravihara/react-native-testing-package@praella/localisationistjeuxuijrennsoh88-react-native-scroll-indicatorjesh-calculationjnf-accesscontrol-rnttljordy-frijters-test-libjosh-fcakhaled-salem-custom-components3.0.0@brucearmstrong/sass-librarylayui-customjawwy_library_newjawy_library_v1gamification-jawwy-libraryframework_test_library_sixdee_new_jawwytest_lib_module_aardfeuk-frontenddfeuk-frontend-manualquickcapture_react_nativern-agora-ios-mreact-native-omental-frameworkreact-native-sixdee_test_libtinymce-plugin-toy@amirdiafi/react-native-ios-haptics@asiz33/smartblok-vendure-plugin@aviinash_jha/react-native-test_multiply@ali5049/react-native-buttons@alanastor/robylon-react-native-sdk@aysea/react-native-ui-library@brantalikp/rn-resize@acm-will/add-to-calendar-button@adatechnology/react-native-android-getnet-pos@adembacaj/react-native-google-pay@_nomtek/react-native-shimmer-animation@azalpacir/react-native-dhp-printer@benovshe/sasslibraryyarn-react-hook-formzylwc-starterkit@headgum/tko-mapping@idas1/ui-component-lib@labiebhn_/react-native-multiplier@lofcz/sweetalert2-neutral@lehuyaa/my-assets@isogand/react-native-sliding-counter@litedexdev/litedex-core-swap@mariomui/cans@navabi/react-native-ssl-pinning@enkeledi/react-native-week-month-date-picker@extrieve_technologies/quickcapture_react_native@faizanhaider/iconsax@min98/layui-custom@ko-developerhong/react-native-multiple-image-picker@jfilipe-sparta/react-native-module_2@igniswap/igni-swap-lib@oiti/rn-liveness2d
0.1.2

9 years ago

0.1.1

10 years ago

0.1.0

10 years ago