
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How to validate an email id using regular expression in Python?
The following code validates any given email id using regex in Python
Example
import re s = 'manogna.neelam@tutorialspoint.com' match = re.search(r'\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b', s, re.I) print match.group()
Output
This gives the output
manogna.neelam@tutorialspoint.com
- Related Articles
- How to extract email id from text using Python regular expression?
- How to validate an email address using Java regular expressions.
- Java regular expression program to validate an email including blank field valid as well
- How to validate a URL using regular expression in C#?
- How to write a Python Regular Expression to validate numbers?
- How to validate email using jQuery?
- How to validate an email address in C#?
- How do you validate a URL with a regular expression in Python?
- How to validate email address using RegExp in JavaScript?
- How to validate an email address in PHP ?\n
- Python program to validate email address
- Extracting email addresses using regular expressions in Python
- How to validate email address in JavaScript?
- How to match only digits in Python using Regular Expression?
- How to match a word in python using Regular Expression?

Advertisements