The pattern @([^\s@]+) captures the text following an at sign up to whitespace or another at sign. For [email protected] [email protected], its groups are example.org and team.example.net.

@([^\s@]+) as the pattern.[email protected] [email protected] as test text.@, while group 1 contains the following domain-like text.Pattern: @([^\s@]+) Text: [email protected] [email protected] Groups: example.org, team.example.net
Turn off g - Global to see only the first match, then turn it back on for both.

This teaching pattern also accepts some malformed address-like text and can include trailing punctuation. It does not validate an email address, confirm a mailbox exists, or prove ownership.