Remove usage of deprecated function getPattern()