Add utility method for pattern matching

[Amendment to 507a18791acb0c7e7acc133bbb5e8ad71b21643b.]

i18n assertion methods in I18nChecker use the new utility.