Here are some best practices, from Salesforce, for building landing pages.
You should start by including following security headers in your Cloud Pages, especially to avoid XSS:
Duh, writing this question prompted me to Google some different keywords to come up with the nice simple answer of class="slds-form--inline":
<lightning-record-edit-form object-api-name="Contact" class="slds-form--inline">
As described, HTML5 has the "pattern" attribute that you can use to validate form fields on the frontend.
Frontend validation is good to improve the usability of the page for the user.
You can utilize the RegexMatch() AMPScript Function to mirror this logic on the backend. Backend validation should be employed as a security measure, should someone try to ...