todo-regex

0.1.1 • Public • Published

todo-regex NPM version

Regular expression for matching TODO statements in a string.

Install

Install with npm

$ npm i todo-regex --save

Usage

var regex = require('todo-regex');

Examples

(Any of the following can start with todo or @todo and an optional colon)

JavaScript line comments:

var match = '// todo: foo bar baz'.match(regex());
//=> 'foo bar baz'

JavaScript block comments:

var match = '/*\n * @todo one two three\n */'.match(regex());
//=> 'one two three'

HTML comments:

var match = '<!-- todo: foo bar baz -->'.match(regex());
//=> 'foo bar baz'

Related projects

  • copyright-regex: Regex for matching and parsing copyright statements.
  • dotfile-regex: Regular expresson for matching dotfiles.
  • path-regex: Regular expression for matching the parts of a file path.

Running 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


This file was generated by verb-cli on May 26, 2015.

Package Sidebar

Install

npm i todo-regex

Weekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • doowb
  • jonschlinkert