Skip to content

Regular expression for matching TODO statements in a string.

License

Notifications You must be signed in to change notification settings

regexhq/todo-regex

Repository files navigation

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

  • 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.

About

Regular expression for matching TODO statements in a string.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published