added compiled patterns to use them instead of String.matches-method