Properly handle invalid regexps for header_matches patterns.
Fixes #418 (closed)
This will catch and log the re.error that is thrown if a header_matches
pattern is invalid.
It also updates REST so invalid patterns can't be set.
Edited by Mark Sapiro