Describe the solution you'd like
Currently, the "Person" model lacks an email field and validation. To improve data handling, we should:
- Add a new email field to the "Person" model.
- Implement regex validation to ensure that the email format is correct.
- Update the user interface to handle email input validation when adding or updating a person.
Additional context
-
Email Field:
Add an email attribute to the "Person" class with appropriate getter and setter methods.
-
Regex Validation:
Use the following regex pattern to validate email format:
String emailRegex = "^[a-zA-Z0-9_+&-]+(?:\.[a-zA-Z0-9_+&-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,7}$";
-
Menu or App Changes:
Update the form or input pane in the app or menu to include the email field
When adding or editing a person, validate the email using the regex. If the email is invalid, show an error message like "Invalid email format."
-
Error Handling in the App:
If the email fails validation, prevent the user from saving or updating the record and display a message asking them to correct the email format.
Expected sample

Describe the solution you'd like
Currently, the "Person" model lacks an email field and validation. To improve data handling, we should:
Additional context
Email Field:
Add an email attribute to the "Person" class with appropriate getter and setter methods.
Regex Validation:
Use the following regex pattern to validate email format:
String emailRegex = "^[a-zA-Z0-9_+&-]+(?:\.[a-zA-Z0-9_+&-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,7}$";
Menu or App Changes:
Update the form or input pane in the app or menu to include the email field
When adding or editing a person, validate the email using the regex. If the email is invalid, show an error message like "Invalid email format."
Error Handling in the App:
If the email fails validation, prevent the user from saving or updating the record and display a message asking them to correct the email format.
Expected sample