Only create the regular expression for content/sender matches once.

Fixes #1227.