Programming Exercises

Extract all valid email addresses from a given string using regex.

Hard

Problem Statement

Extract all valid email addresses from a given string using regex.

Sample Input

'Contact me at example@mail.com or test@example.org'

Sample Output

["example@mail.com", "test@example.org"]

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
def extract_emails(text) # Your code here end
Log in or sign up to run or submit your code.Log inSign up
Input
'Contact me at example@mail.com or test@example.org'
Expected Output
["example@mail.com", "test@example.org"]