newline-regex

Regex for newline characters

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
newline-regex
2120.2.19 years ago9 years agoMinified + gzip package size for newline-regex in KB

Readme

newline-regex
NPM version Build Status Coverage Status
Code Climate Dependencies DevDependencies
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