FIX: Replace use of regular expression (#12838) (PR #12852)

It used a regular expression to check if message IDs were in RFC format.

GitHub