Fix and simplify h/w regex checks.