(?i-msx:\bBug {0,1}(\d+):) matches as follows:   NODE                     EXPLANATION ---------------------------------------------------------------------- (?i-msx:                 group, but do not capture (case-insensitive)                         (with ^ and $ matching normally) (with . not                         matching \n) (matching whitespace and #                         normally): ----------------------------------------------------------------------  \b                       the boundary between a word char (\w) and                           something that is not a word char ----------------------------------------------------------------------  Bug                      'Bug' ----------------------------------------------------------------------   {0,1}                   ' ' (between 0 and 1 times (matching the                           most amount possible)) ----------------------------------------------------------------------  (                        group and capture to \1: ----------------------------------------------------------------------    \d+                      digits (0-9) (1 or more times (matching                             the most amount possible)) ----------------------------------------------------------------------  )                        end of \1 ----------------------------------------------------------------------  :                        ':' ---------------------------------------------------------------------- )                        end of grouping ----------------------------------------------------------------------