Home

Awesome

todo-regex NPM version Build Status

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

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.