{"_id":"gfm-code-block-regex","_rev":"37497","name":"gfm-code-block-regex","description":"RegExp for gfm (GitHub Flavored Markdown) fenced code blocks.","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"jonschlinkert","email":""}],"time":{"modified":"2023-09-20T22:02:42.000Z","created":"2014-08-13T08:47:14.993Z","1.0.0":"2017-03-16T15:38:35.460Z","0.2.3":"2015-12-09T12:16:56.202Z","0.2.1":"2014-09-24T00:48:16.456Z","0.2.0":"2014-09-23T23:08:08.181Z","0.1.2":"2014-08-13T09:52:25.239Z","0.1.1":"2014-08-13T08:57:55.705Z","0.1.0":"2014-08-13T08:47:14.993Z"},"users":{},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/regexhq/gfm-code-block-regex.git"},"versions":{"1.0.0":{"name":"gfm-code-block-regex","description":"RegExp for gfm (GitHub Flavored Markdown) fenced code blocks.","version":"1.0.0","homepage":"https://github.com/regexhq/gfm-code-block-regex","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/regexhq/gfm-code-block-regex.git"},"bugs":{"url":"https://github.com/regexhq/gfm-code-block-regex/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"devDependencies":{"gulp-format-md":"^0.1.11"},"keywords":["block","code","exec","expression","fence","fenced","fences","flavor","flavored","gfm","github","markdown","match","matches","pattern","patterns","re","regex","regexp","regular","replace","replacement"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["extract-gfm","gfm-code-blocks","to-gfm-code-block"]},"lint":{"reflinks":true}},"gitHead":"91fd47dae730c5da36bd939acac416de221ff5d4","_id":"gfm-code-block-regex@1.0.0","_shasum":"bb83c7d6284e6b5b72fa02198a58ac0d256215d2","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.6.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":""}],"dist":{"shasum":"bb83c7d6284e6b5b72fa02198a58ac0d256215d2","size":2838,"noattachment":false,"key":"/gfm-code-block-regex/-/gfm-code-block-regex-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/gfm-code-block-regex/download/gfm-code-block-regex-1.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/gfm-code-block-regex-1.0.0.tgz_1489678714731_0.28791789431124926"},"directories":{},"publish_time":1489678715460,"_cnpm_publish_time":1489678715460,"_hasShrinkwrap":false},"0.2.3":{"name":"gfm-code-block-regex","description":"RegExp for gfm (GitHub Flavored Markdown) fenced code blocks.","version":"0.2.3","homepage":"https://github.com/jonschlinkert/gfm-code-block-regex","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/gfm-code-block-regex.git"},"bugs":{"url":"https://github.com/jonschlinkert/gfm-code-block-regex/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"*","test-helpers":"^0.1.4"},"keywords":["block","code","exec","expression","fence","fenced","fences","flavor","flavored","gfm","github","markdown","match","matches","pattern","patterns","re","regex","regexp","regular","replace","replacement"],"verb":{"plugins":["gulp-format-md"],"related":{"list":["to-gfm-code-block","extract-gfm","gfm-code-blocks"]}},"gitHead":"87bc0afe5d5d8e6862e7da066520aedc145b44bb","_id":"gfm-code-block-regex@0.2.3","_shasum":"0b9fe68acf2c5a5022fd6d2d418a634f6e97c110","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":""}],"dist":{"shasum":"0b9fe68acf2c5a5022fd6d2d418a634f6e97c110","size":2166,"noattachment":false,"key":"/gfm-code-block-regex/-/gfm-code-block-regex-0.2.3.tgz","tarball":"http://name.csiicloud.com:7001/gfm-code-block-regex/download/gfm-code-block-regex-0.2.3.tgz"},"directories":{},"publish_time":1449663416202,"_cnpm_publish_time":1449663416202,"_hasShrinkwrap":false},"0.2.1":{"name":"gfm-code-block-regex","description":"RegExp for gfm (GitHub Flavored Markdown) fenced code blocks.","version":"0.2.1","homepage":"https://github.com/jonschlinkert/gfm-code-block-regex","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/gfm-code-block-regex.git"},"bugs":{"url":"https://github.com/jonschlinkert/gfm-code-block-regex/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/gfm-code-block-regex/blob/master/LICENSE-MIT"}],"keywords":["block","code","exec","expression","fence","fenced","fences","flavor","flavored","gfm","github","markdown","match","matches","pattern","patterns","re","regex","regexp","regular","replace","replacement"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"mocha":"*","test-helpers":"^0.1.2","verb":"^0.2.15"},"_id":"gfm-code-block-regex@0.2.1","_shasum":"74b221b49089df2c3eed1aae1987ec5756256da7","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":""}],"dist":{"shasum":"74b221b49089df2c3eed1aae1987ec5756256da7","size":3587,"noattachment":false,"key":"/gfm-code-block-regex/-/gfm-code-block-regex-0.2.1.tgz","tarball":"http://name.csiicloud.com:7001/gfm-code-block-regex/download/gfm-code-block-regex-0.2.1.tgz"},"directories":{},"publish_time":1411519696456,"_cnpm_publish_time":1411519696456,"_hasShrinkwrap":false},"0.2.0":{"name":"gfm-code-block-regex","description":"RegExp for gfm (GitHub Flavored Markdown) fenced code blocks.","version":"0.2.0","homepage":"https://github.com/jonschlinkert/gfm-code-block-regex","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/gfm-code-block-regex.git"},"bugs":{"url":"https://github.com/jonschlinkert/gfm-code-block-regex/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/gfm-code-block-regex/blob/master/LICENSE-MIT"}],"keywords":["block","code","exec","expression","fence","fenced","fences","flavor","flavored","gfm","github","markdown","match","matches","pattern","patterns","re","regex","regexp","regular","replace","replacement"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"mocha":"*","test-helpers":"^0.1.2","verb":"^0.2.15"},"_id":"gfm-code-block-regex@0.2.0","_shasum":"35d7e1d62d3ee331247c97b6b4e127e8fc23dee3","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":""}],"dist":{"shasum":"35d7e1d62d3ee331247c97b6b4e127e8fc23dee3","size":3586,"noattachment":false,"key":"/gfm-code-block-regex/-/gfm-code-block-regex-0.2.0.tgz","tarball":"http://name.csiicloud.com:7001/gfm-code-block-regex/download/gfm-code-block-regex-0.2.0.tgz"},"directories":{},"publish_time":1411513688181,"_cnpm_publish_time":1411513688181,"_hasShrinkwrap":false},"0.1.2":{"name":"gfm-code-block-regex","description":"RegExp for gfm (GitHub Flavored Markdown) fenced code blocks.","version":"0.1.2","homepage":"https://github.com/jonschlinkert/gfm-code-block-regex","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/gfm-code-block-regex.git"},"bugs":{"url":"https://github.com/jonschlinkert/gfm-code-block-regex/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/gfm-code-block-regex/blob/master/LICENSE-MIT"}],"keywords":["block","code","exec","expression","fence","fenced","fences","flavor","flavored","gfm","github","markdown","match","matches","pattern","patterns","re","regex","regexp","regular","replace","replacement"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"mocha":"*","test-helpers":"^0.1.2","verb":"^0.2.15"},"_id":"gfm-code-block-regex@0.1.2","_shasum":"cc82b0b40ca3420f2ed6c923772de916ef16c6fe","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":""}],"dist":{"shasum":"cc82b0b40ca3420f2ed6c923772de916ef16c6fe","size":3386,"noattachment":false,"key":"/gfm-code-block-regex/-/gfm-code-block-regex-0.1.2.tgz","tarball":"http://name.csiicloud.com:7001/gfm-code-block-regex/download/gfm-code-block-regex-0.1.2.tgz"},"directories":{},"publish_time":1407923545239,"_cnpm_publish_time":1407923545239,"_hasShrinkwrap":false},"0.1.1":{"name":"gfm-code-block-regex","description":"RegExp for gfm (GitHub Flavored Markdown) code blocks.","version":"0.1.1","homepage":"https://github.com/jonschlinkert/gfm-code-block-regex","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/gfm-code-block-regex.git"},"bugs":{"url":"https://github.com/jonschlinkert/gfm-code-block-regex/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/gfm-code-block-regex/blob/master/LICENSE-MIT"}],"keywords":["array","block","char","characters","chars","code","escape","exec","expression","fence","fenced","fences","find","flavor","flavored","gfm","github","group","markdown","match","matches","pattern","patterns","re","regex","regexp","regular","replace","replacement","reserved","special","str","string"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"mocha":"*","test-helpers":"^0.1.2","verb":"^0.2.15"},"_id":"gfm-code-block-regex@0.1.1","_shasum":"810da462280b9906ec749b4c8de08047abb01fe0","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":""}],"dist":{"shasum":"810da462280b9906ec749b4c8de08047abb01fe0","size":3433,"noattachment":false,"key":"/gfm-code-block-regex/-/gfm-code-block-regex-0.1.1.tgz","tarball":"http://name.csiicloud.com:7001/gfm-code-block-regex/download/gfm-code-block-regex-0.1.1.tgz"},"directories":{},"publish_time":1407920275705,"_cnpm_publish_time":1407920275705,"_hasShrinkwrap":false},"0.1.0":{"name":"gfm-code-block-regex","description":"RegExp for GitHub Flavored Markdown.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/gfm-code-block-regex","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/gfm-code-block-regex.git"},"bugs":{"url":"https://github.com/jonschlinkert/gfm-code-block-regex/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/gfm-code-block-regex/blob/master/LICENSE-MIT"}],"keywords":["docs","documentation","generate","generator","markdown","templates","verb"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"mocha":"*","test-helpers":"^0.1.2"},"_id":"gfm-code-block-regex@0.1.0","_shasum":"8bd25722ef92f798c6ac901860ad5c7c5f8832eb","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":""}],"dist":{"shasum":"8bd25722ef92f798c6ac901860ad5c7c5f8832eb","size":3238,"noattachment":false,"key":"/gfm-code-block-regex/-/gfm-code-block-regex-0.1.0.tgz","tarball":"http://name.csiicloud.com:7001/gfm-code-block-regex/download/gfm-code-block-regex-0.1.0.tgz"},"directories":{},"publish_time":1407919634993,"_cnpm_publish_time":1407919634993,"_hasShrinkwrap":false}},"readme":"# gfm-code-block-regex [![NPM version](https://img.shields.io/npm/v/gfm-code-block-regex.svg?style=flat)](https://www.npmjs.com/package/gfm-code-block-regex) [![NPM monthly downloads](https://img.shields.io/npm/dm/gfm-code-block-regex.svg?style=flat)](https://npmjs.org/package/gfm-code-block-regex)  [![NPM total downloads](https://img.shields.io/npm/dt/gfm-code-block-regex.svg?style=flat)](https://npmjs.org/package/gfm-code-block-regex) [![Linux Build Status](https://img.shields.io/travis/regexhq/gfm-code-block-regex.svg?style=flat&label=Travis)](https://travis-ci.org/regexhq/gfm-code-block-regex)\n\n> RegExp for gfm (GitHub Flavored Markdown) fenced code blocks.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save gfm-code-block-regex\n```\n\n## Usage\n\n```js\nvar re = require('gfm-code-block-regex');\n\nvar match = re().exec('random text \\n```js\\nfoo\\n```\\n more random text');\nconsole.log(match);\n```\n\nReturns:\n\n```js\n[ '```sh\\nnpm install micromatch --save-dev\\n```',\n  '```sh\\nnpm install micromatch --save-dev\\n```',\n  '```',\n  'sh',\n  '\\nnpm install micromatch --save-dev\\n',\n  '```',\n  index: 4,\n  input: 'foo\\n```sh\\nnpm install micromatch --save-dev\\n```\\nbar' ]\n```\n\n## Heads up!\n\nNote that if a gfm code block has a javascript block comment inside of it, and within the block comment is another gfm code block, it will fail if the block comment does not have leading stars.\n\n**Examples**\n\nThis should work:\n\n<pre>\n```js\n/**\n * This is a comment with\n * several lines of text.\n *\n * An example\n *\n * ```js\n * var foo = bar;\n * var foo = bar;\n * var foo = bar;\n * ```\n*/\n```\n</pre>\n\nThis will not work (note the absence of leading stars inside the comment):\n\n<pre>\n```js\n/**\n  This is a comment with\n  several lines of text.\n\n  An example\n\n  ```js\n  var foo = bar;\n  var foo = bar;\n  var foo = bar;\n  ```\n */\n```\n</pre>\n\nAlthough the previous example is perfectly valid, regex alone is not sufficient.\n\n## About\n### Related projects\n- [extract-gfm](https://www.npmjs.com/package/extract-gfm): Utilities for extracting and replacing GitHub Flavored Markdown code blocks. For example, you could easily… [more](https://github.com/jonschlinkert/extract-gfm) | [homepage](https://github.com/jonschlinkert/extract-gfm \"Utilities for extracting and replacing GitHub Flavored Markdown code blocks. For example, you could easily find code blocks for a specific language and run the code through a linter.\")\n- [gfm-code-blocks](https://www.npmjs.com/package/gfm-code-blocks): Extract gfm (GitHub Flavored Markdown) fenced code blocks from a string. | [homepage](https://github.com/jonschlinkert/gfm-code-blocks \"Extract gfm (GitHub Flavored Markdown) fenced code blocks from a string.\")\n- [to-gfm-code-block](https://www.npmjs.com/package/to-gfm-code-block): Generate a github-flavored-markdown fenced-code-block snippet. | [homepage](https://github.com/jonschlinkert/to-gfm-code-block \"Generate a github-flavored-markdown fenced-code-block snippet.\")\n\n### Contributing\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Contributors\n\n### Release history\n\n### Building docs\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on March 16, 2017._","_attachments":{},"homepage":"https://github.com/regexhq/gfm-code-block-regex","bugs":{"url":"https://github.com/regexhq/gfm-code-block-regex/issues"},"license":"MIT"}