change 'not' matching to use Pattern, move pattern parsing logic into