Test, validate and match regular expressions
This regex captures the local part (username) of an email address by matching alphanumeric characters and dots immediately preceding the '@' symbol. It utilizes a positive lookahead to assert that a valid domain structure follows without consuming it in the final match. This is particularly useful for extracting first names or handles from a block of text containing multiple email addresses.