Regular Expressions 101

Community Patterns

Inline TODO Regex

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^TODO \(\w{2,6}[-|–|—]\d{1,6}\):.*$
/
gm

Description

My idea is to use this as a regex for linters,

TODO: Do the thing

Should fail many linters, however, with with this regex in place, the below format would be accepted.

TODO (SIT-1234): Do the thing
Submitted by Graf - 2 years ago