{"_id":"comment-regex","_rev":"1225363","name":"comment-regex","description":"Regular expression for matching JavaScript comments","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-10-13T17:16:16.000Z","created":"2014-09-13T11:28:02.057Z","2.0.0":"2021-10-13T17:03:49.039Z","1.0.1":"2018-03-23T08:41:47.321Z","1.0.0":"2014-09-13T11:28:02.057Z"},"users":{"farskipper":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/comment-regex.git"},"versions":{"2.0.0":{"name":"comment-regex","version":"2.0.0","description":"Regular expression for matching JavaScript comments","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/comment-regex.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava"},"keywords":["text","string","regex","regexp","match","test","find","pattern","comment","comments","js","javascript","line","block"],"devDependencies":{"ava":"^3.15.0","xo":"^0.45.0"},"gitHead":"e9a198aed2bc25a35ac4773786b4763778c1c878","bugs":{"url":"https://github.com/sindresorhus/comment-regex/issues"},"homepage":"https://github.com/sindresorhus/comment-regex#readme","_id":"comment-regex@2.0.0","_nodeVersion":"14.17.5","_npmVersion":"7.20.3","dist":{"shasum":"9836276ba088ead0d71abdc2f68596b5e7b1c1af","size":1686,"noattachment":false,"key":"/comment-regex/-/comment-regex-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/comment-regex/download/comment-regex-2.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/comment-regex_2.0.0_1634144628859_0.7365437919436029"},"_hasShrinkwrap":false,"publish_time":1634144629039,"_cnpm_publish_time":1634144629039},"1.0.1":{"name":"comment-regex","version":"1.0.1","description":"Regular expression for matching JavaScript comments","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/comment-regex.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"ava"},"files":["index.js"],"keywords":["text","string","regex","regexp","re","match","test","find","pattern","comment","comments","js","javascript","line","block"],"devDependencies":{"ava":"*"},"gitHead":"7cfc559dc6954b7d75dea7d2a2c434da12f49f7d","bugs":{"url":"https://github.com/sindresorhus/comment-regex/issues"},"homepage":"https://github.com/sindresorhus/comment-regex#readme","_id":"comment-regex@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"e070d2c4db33231955d0979d27c918fcb6f93565","size":1733,"noattachment":false,"key":"/comment-regex/-/comment-regex-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/comment-regex/download/comment-regex-1.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/comment-regex_1.0.1_1521794507279_0.8705761873687534"},"_hasShrinkwrap":false,"publish_time":1521794507321,"_cnpm_publish_time":1521794507321},"1.0.0":{"name":"comment-regex","version":"1.0.0","description":"Regular expression for matching JavaScript comments","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/comment-regex"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js"],"keywords":["text","string","regex","regexp","re","match","test","find","pattern","comment","comments","js","javascript","line","block"],"devDependencies":{"ava":"0.0.4"},"gitHead":"a3d4222bef18d8b09993542738a28d7916d60405","bugs":{"url":"https://github.com/sindresorhus/comment-regex/issues"},"homepage":"https://github.com/sindresorhus/comment-regex","_id":"comment-regex@1.0.0","_shasum":"7dd70268c83648a9c4cc19bf472d52e64f63918d","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"7dd70268c83648a9c4cc19bf472d52e64f63918d","size":1066,"noattachment":false,"key":"/comment-regex/-/comment-regex-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/comment-regex/download/comment-regex-1.0.0.tgz"},"directories":{},"publish_time":1410607682057,"_cnpm_publish_time":1410607682057,"_hasShrinkwrap":false}},"readme":"# comment-regex\n\n> Regular expression for matching JavaScript comments\n\n*This is pretty fragile and created for performance reasons where using a real parser would be overkill. Do not use it with untrusted user input.*\n\n## Install\n\n```sh\nnpm install comment-regex\n```\n\n## Usage\n\n```js\nimport {commentRegex} from 'comment-regex';\n\n// Contains a comment\ncommentRegex().test('/* unicorn */\\nvar foo = true;');\n//=> true\n\n// Get the contents of a comment\ncommentRegex().exec('/* unicorn */\\nvar foo = true;')[2].trim();\n\n// Get all the comments\n'/* unicorn */\\nvar foo = true;\\nvar unicorn = \"rainbows\"; // rainbow'.match(commentRegex());\n//=> ['/* unicorn */', ' // rainbow']\n```\n\n## API\n\nThe contents of the comment is in the first submatch.\n\n### commentRegex()\n\nReturns a regex for matching line and block comments.\n\n### lineCommentRegex()\n\nReturns a regex for matching line comments.\n\n### blockCommentRegex()\n\nReturns a regex for matching block comments.\n","_attachments":{},"homepage":"https://github.com/sindresorhus/comment-regex#readme","bugs":{"url":"https://github.com/sindresorhus/comment-regex/issues"},"license":"MIT"}