Generate and explain regular expression patterns.
{{purpose}}What to match
Example: Validate email addresses
{{regex_flavor}}Regex flavor
Example: JavaScript
{{match_examples}}Should match
Example: user@example.com name.last@domain.co.uk
{{no_match_examples}}Should not match
Example: invalid@ @nodomain.com
Create a Python regex to extract phone numbers matching formats like 555-123-4567 and (555) 123-4567.