explicitly compile the regular expressions
use _ naming convention for private methods
rename _is_pattern_match to _pattern_match to be more clear about the return type
ensure the same exclusions are applied to the cms