has-regex-chars

0.1.1 • Public • Published

has-regex-chars NPM version

Returns true if a string has regular expression special characters.

Install with npm

npm i has-regex-chars --save

Usage

var hasRegexChars = require('has-regex-chars');
 
hasRegexChars('$100');
//=> true
 
// all of the following are `true`
hasRegexChars('(');
hasRegexChars(')');
hasRegexChars('*');
hasRegexChars('+');
hasRegexChars('.');
hasRegexChars('/');
hasRegexChars('?');
hasRegexChars('[');
hasRegexChars('\\');
hasRegexChars(']');
hasRegexChars('^');
hasRegexChars('{');
hasRegexChars('|');
hasRegexChars('}');

Run tests

Install dev dependencies:

npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright (c) 2015 Jon Schlinkert
Released under the MIT license


This file was generated by verb on February 25, 2015.

Readme

Keywords

none

Package Sidebar

Install

npm i has-regex-chars

Weekly Downloads

4

Version

0.1.1

License

MIT

Last publish

Collaborators

  • doowb
  • jonschlinkert