{"_id":"is-equal-regex","_rev":"1654546","name":"is-equal-regex","description":"Returns true if regular expression A is equal to regex B. Compares the expression and flags.","dist-tags":{"latest":"0.1.0"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2026-10-30T18:51:47.000Z","created":"2015-07-28T01:35:13.557Z","0.1.0":"2015-07-28T01:35:13.557Z"},"users":{},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/is-equal-regex.git"},"versions":{"0.1.0":{"name":"is-equal-regex","description":"Returns true if regular expression A is equal to regex B. Compares the expression and flags.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/is-equal-regex","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/is-equal-regex.git"},"bugs":{"url":"https://github.com/jonschlinkert/is-equal-regex/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"kind-of":"^2.0.0"},"devDependencies":{"mocha":"*"},"keywords":["compare","comparison","equal","equals","expression","flag","flags","global","is","regex","regexp","regular","same","source"],"verb":{"related":{"list":["isobject","is-plain-object","is-equal-shallow"]}},"_id":"is-equal-regex@0.1.0","_shasum":"8e65861ff55dadec9cd57d66100b1a44be2b1a5f","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"8e65861ff55dadec9cd57d66100b1a44be2b1a5f","tarball":"http://registry-npm.ywwl.com/is-equal-regex/download/is-equal-regex-0.1.0.tgz","integrity":"sha512-+qtImuMJ0wDIv2raPQ7RarB2Q7NEgs01jLkidUh/k/15O4YQnnd2+ejdPOFYqJNbSSq32H8tt/hsIUTHDmpbvQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBH7E6bxlWUiUmylNela/oOSq5BTPWortqIIAIvnzOCgIhAN3C3igueKdrrTe3PGtyd1oyCo5bCClaCsTjvkuznoJc"}],"size":2242,"noattachment":false,"key":"/is-equal-regex/-/is-equal-regex-0.1.0.tgz"},"publish_time":1438047313557,"_cnpm_publish_time":1438047313557}},"readme":"# is-equal-regex [![NPM version](https://badge.fury.io/js/is-equal-regex.svg)](http://badge.fury.io/js/is-equal-regex)\n\n> Returns true if regular expression A is equal to regex B. Compares the expression and flags.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/)\n\n```sh\n$ npm i is-equal-regex --save\n```\n\n## Usage\n\n```js\nvar isEqualRegex = require('is-equal-regex');\n\nisEqualRegex(/foo/, /foo/);\n//=> true\nisEqualRegex(/foo/g, /foo/g);\n//=> true\n\nisEqualRegex(/foo/, /bar/);\n//=> false\nisEqualRegex(/foo/g, /foo/);\n//=> false\n```\n\n## Related projects\n\n* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null.\n* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor.\n* [is-equal-shallow](https://github.com/jonschlinkert/is-equal-shallow): Does a shallow comparison of two objects, returning false if the keys or values differ.\n\n## Examples\n\n**True**\n\nAll of the following return `true`:\n\n```js\nisEqualRegex(/foo/, /foo/);\nisEqualRegex(/^bar/, /^bar/);\nisEqualRegex(/foo/g, /foo/g);\nisEqualRegex(/^bar$/, new RegExp('^bar$'));\nisEqualRegex(/^bar$/gmi, new RegExp('^bar$', 'gmi'));\nisEqualRegex(new RegExp('^bar$'), /^bar$/);\nisEqualRegex(new RegExp('^bar$', 'gmi'), /^bar$/gmi);\n```\n\n**False**\n\nAll of the following return `false`:\n\n```js\nisEqualRegex(/^bar$/gmi, new RegExp('^bar$'));\nisEqualRegex(new RegExp('^bar$'), /^bar$/gmi);\nisEqualRegex('a');\nisEqualRegex('a', /foo/);\nisEqualRegex();\nisEqualRegex(/foo/);\nisEqualRegex(/foo/, /bar/);\nisEqualRegex(/foo/, /foo/gm);\nisEqualRegex(/foo/, 'a');\nisEqualRegex(/foo/, /^foo/);\nisEqualRegex(/foo/, /bar/);\nisEqualRegex(/foo/, []);\nisEqualRegex(/foo/, new Date());\nisEqualRegex(/foo/, null);\nisEqualRegex(/foo/, undefined);\nisEqualRegex(/foo/, {});\nisEqualRegex(/foo/g, /foo/);\nisEqualRegex([]);\nisEqualRegex(new Date(), /foo/);\nisEqualRegex(null);\nisEqualRegex(undefined);\nisEqualRegex({});\n```\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm i -d && npm test\n```\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-equal-regex/issues/new)\n\n## Author\n\n**Jon Schlinkert**\n\n+ [github/jonschlinkert](https://github.com/jonschlinkert)\n+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n## License\n\nCopyright © 2015 Jon Schlinkert\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 27, 2015._","_attachments":{},"homepage":"https://github.com/jonschlinkert/is-equal-regex","bugs":{"url":"https://github.com/jonschlinkert/is-equal-regex/issues"},"license":"MIT"}