Rules: required, min 5, contains @, contains a dot.
You stack multiple guard rules and show the first failure (or all failures in a mode).
Open the code and try the variant ideas listed in comments near the bottom.