Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dustinspecker/newline-regex
Regex for newline characters
https://github.com/dustinspecker/newline-regex
Last synced: 2 days ago
JSON representation
Regex for newline characters
- Host: GitHub
- URL: https://github.com/dustinspecker/newline-regex
- Owner: dustinspecker
- License: mit
- Created: 2015-07-02T20:29:44.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-31T21:39:27.000Z (over 7 years ago)
- Last Synced: 2024-04-25T23:44:47.057Z (7 months ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# newline-regex
[![NPM version](https://badge.fury.io/js/newline-regex.svg)](https://badge.fury.io/js/newline-regex) [![Build Status](https://travis-ci.org/dustinspecker/newline-regex.svg)](https://travis-ci.org/dustinspecker/newline-regex) [![Coverage Status](https://img.shields.io/coveralls/dustinspecker/newline-regex.svg)](https://coveralls.io/r/dustinspecker/newline-regex?branch=master)[![Code Climate](https://codeclimate.com/github/dustinspecker/newline-regex/badges/gpa.svg)](https://codeclimate.com/github/dustinspecker/newline-regex) [![Dependencies](https://david-dm.org/dustinspecker/newline-regex.svg)](https://david-dm.org/dustinspecker/newline-regex/#info=dependencies&view=table) [![DevDependencies](https://david-dm.org/dustinspecker/newline-regex/dev-status.svg)](https://david-dm.org/dustinspecker/newline-regex/#info=devDependencies&view=table)
> Regex for newline characters
## Install
```
npm install --save newline-regex
```## Usage
```javascript
var newlineRegex = require('newline-regex');newlineRegex.test('Unix\n');
// => truenewlineRegex.test('Windows\r\n');
// => truenewlineRegex.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