As you're using the same regex twice, you might want to move it to a constant, like `VALID_SYNTAX` above.