Add utility method for pattern matching

i18n assertion methods in I18nChecker use the new utility.