0.1.1 • Published 9 years ago

has-regex-chars v0.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

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.