Merge pull request #1040 from blackwhale/regex-bug9211

Regex bugfix (issue 9211). I assume FreeBSD's failure is unrelated.