Make POSIX regex checks cleaner.