TODO/FIXME Comment
beginnerMatches TODO, FIXME, HACK, and XXX comments in code.
todofixmecommentdevelopment
Pattern
/(?://|#|/\*)\s*(?:TODO|FIXME|HACK|XXX|BUG|NOTE)\b[:\s]?(.*?)(?:\*/)?$/gimTry It
0 of 7 strings matched
Explanation
Matches common code annotation comments (TODO, FIXME, HACK, XXX, BUG, NOTE) after comment delimiters (//, #, /*). Captures the comment text.
Test Strings
Matching
- // TODO: fix this later
- # FIXME: broken on Windows
- /* HACK: workaround for bug */
- // NOTE: important detail
Non-matching
- todo without comment marker
- // just a normal comment
- FIXME in prose
Language Compatibility
| Language | Support |
|---|---|
| JS | Full support |
| PYTHON | Full support |
| JAVA | Full support |
| PHP | Full support |
| GO | Full support |
Code Snippets
const regex = /(?:\/\/|#|\/\*)\s*(?:TODO|FIXME|HACK|XXX|BUG|NOTE)\b[:\s]?(.*?)(?:\*\/)?$/gim;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);