Make regexes more idiomatic and readable

- Use === when boolean return value is wanted
- Store regex in a constant