Let's assume a task which has been given your
boss or teacher or staff's.
(i.e) Get domain name of the email address of
the students in the class or the employee's in the office.
Tips : Get all characters next to @ symbol .
Source Code:
import re
variable=re.findall(r"@\w+",
"dharani@gmail.com, dharan@googlebird.in, mymail@bird.com,
dd@facebook.com")
print variable
Output:
F:\Knowledge\Python\LearningProgramsOwn>Domain.py
['@gmail',
'@googlebird', '@bird', '@facebook']
Explanation :
- import
regular expression.
- re.findall(r"@\w+",
"values@domain.com") - This line is used to extract the
values from the mail address and store in on the variable. Which is an Regex Operation which we learn Previously.
- Print the variable.
To know What is Python Regex ?
- what are the
application of Regex?
Thanks
and regards,
Tech Bird
Comments
Machine Learning training in Pallikranai Chennai
Pytorch training in Pallikaranai chennai
Data science training in Pallikaranai
Python Training in Pallikaranai chennai
Deep learning with Pytorch training in Pallikaranai chennai
Bigdata training in Pallikaranai chennai
Mongodb Nosql training in Pallikaranai chennai
Spark with ML training in Pallikaranai chennai
Data science Python training in Pallikaranai
Bigdata Spark training in Pallikaranai chennai
Sql for data science training in Pallikaranai chennai
Sql for data analytics training in Pallikaranai chennai
Sql with ML training in Pallikaranai chennai