Improved pattern matching with do-not-match-character