What is the purpose of the pattern attribute in form inputs?

pattern enforces a specific regex pattern for input validation, ensuring user input matches the required format.

Example:

<input type="text" pattern="[A-Za-z]{3,}" title="Three or more letters only">