Build, test, and debug regular expressions
This regex validates email addresses by ensuring that both the local and domain parts start and end with an alphanumeric character. It prevents consecutive special characters by using a lookahead for dots, underscores, and hyphens. Additionally, it restricts the top-level domain (TLD) to 2 to 4 alphabetic characters, explicitly mentioning common examples like .com, .ru, and .by.