Issue #1607: Check if style id/name matches pattern with number

When simply using isPrefixOf, there are cases with undesired behavior,
like "HeadingNew" or just "Heading"