Test, validate and match regular expressions
This regex validates strictly formatted email addresses, enforcing rules commonly used by providers like Google and Microsoft. It ensures the local part starts and ends with an alphanumeric character, contains no consecutive dots, and only allows letters, numbers, underscores, hyphens, and dots. The domain section requires each label to start and end with an alphanumeric character, ending with a valid top-level domain.