Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/regexhq/punctuation-regex

Regular expression for matching punctuation characters.
https://github.com/regexhq/punctuation-regex

punctuation punctuation-character regex regular-expression

Last synced: 3 months ago
JSON representation

Regular expression for matching punctuation characters.

Awesome Lists containing this project

README

        

# punctuation-regex [![NPM version](https://img.shields.io/npm/v/punctuation-regex.svg?style=flat)](https://www.npmjs.com/package/punctuation-regex) [![NPM monthly downloads](https://img.shields.io/npm/dm/punctuation-regex.svg?style=flat)](https://npmjs.org/package/punctuation-regex) [![NPM total downloads](https://img.shields.io/npm/dt/punctuation-regex.svg?style=flat)](https://npmjs.org/package/punctuation-regex) [![Linux Build Status](https://img.shields.io/travis/regexhq/punctuation-regex.svg?style=flat&label=Travis)](https://travis-ci.org/regexhq/punctuation-regex)

> Regular expression for matching punctuation characters.

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install --save punctuation-regex
```

See the [wikipedia punctuation](https://en.wikipedia.org/wiki/Punctuation) article for more details.

## Usage

```js
var punctuation = require('punctuation-regex');

// the main export is a function that must be called
console.log(punctuation().test('!'));
//=> true
```

Pass `true` to get a regex for matching the additional "supplemental" characters mentioned in the wikipedia article.

```js
console.log(punctuation(true).test('‘'));
//=> true
```

## About

### Related projects

* [is-punctuation](https://www.npmjs.com/package/is-punctuation): Returns true if the given string is punctuation characters. | [homepage](https://github.com/jonschlinkert/is-punctuation "Returns true if the given string is punctuation characters.")
* [path-root-regex](https://www.npmjs.com/package/path-root-regex): Regular expression for getting the root of a posix or windows filepath. | [homepage](https://github.com/regexhq/path-root-regex "Regular expression for getting the root of a posix or windows filepath.")
* [whitespace-regex](https://www.npmjs.com/package/whitespace-regex): Regular expression for matching the whitespace in a string. | [homepage](https://github.com/regexps/whitespace-regex "Regular expression for matching the whitespace in a string.")
* [word-regex](https://www.npmjs.com/package/word-regex): Regular expression for matching words in a string. Support for english, CJK and Cyrillic. | [homepage](https://github.com/regexps/word-regex "Regular expression for matching words in a string. Support for english, CJK and Cyrillic.")

### Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

Please read the [contributing guide](.github/contributing.md) for avice on opening issues, pull requests, and coding standards.

### Building docs

_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_

To generate the readme and API documentation with [verb](https://github.com/verbose/verb):

```sh
$ npm install -g verb verb-generate-readme && verb
```

### Running tests

Install dev dependencies:

```sh
$ npm install -d && npm test
```

### Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

### License

Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT license](LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.3, on January 04, 2017._