newline-regex
v0.2.1
Published
Regex for newline characters
Downloads
3,983
Readme
newline-regex
Regex for newline characters
Install
npm install --save newline-regex
Usage
var newlineRegex = require('newline-regex');
newlineRegex.test('Unix\n');
// => true
newlineRegex.test('Windows\r\n');
// => true
newlineRegex.test('Nothing');
// => false
// newlineRegex.g is the regex with a global identifier
'Unix\n and Windows\r\n'.match(newlineRegex.g).length;
// => 2
Current Newline Characters Supported
- Unix
- Windows
LICENSE
MIT