Simplify boolean regex