regex-slash

Convert regex pattern strings for Windows backslash paths to Unix paths


License
MIT
Install
npm install regex-slash@1.0.1

Documentation

regex-slash Build Status

Convert regex pattern strings for Windows backslash paths to Unix paths: path\\\\to\\\\file.jspath/to/file.js

Inspired by slash.

Install

$ npm install --save regex-slash

or with yarn

$ yarn add regex-slash

Usage

const rslash = require('regex-slash');

const windowsPattern = 'path\\\\to\\\\file.js';
const unixPattern = 'path/to/file.js';

rslash(windowsPattern); // => 'path/to/file.js'
rslash(unixPattern); // => 'path/to/file.js'

API

rslash(path)

Type: string

Accepts a Windows backslash path regex pattern string and returns a Unix path regex pattern string

License

MIT © Scott Ranger