UrbanPro

Learn Python Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Provide an example of regex pattern matching.

Asked by Last Modified  

Follow 1
Answer

Please enter your answer

Btech Graduate with more than 5 years of experience

import re text = "Please contact supportexample.com for assistance or infocompany.com for more information." # Define the regex pattern for matching email addressespattern = r'\b+@+\.{2,}\b' # Use the re.findall() function to find all matches in the textmatches = re.findall(pattern, text) # Print...
read more

import re

text = "Please contact supportexample.com for assistance or infocompany.com for more information."

# Define the regex pattern for matching email addresses
pattern = r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b'

# Use the re.findall() function to find all matches in the text
matches = re.findall(pattern, text)

# Print the matched email addresses
for match in matches:
print(match) 

 

second alternative 

import re

pattern = r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b'

text = "Contact us at john.doeexample.com for more information."

matches = re.findall(pattern, text)

print(matches)

 

read less
Comments

Related Questions

Is there any online Python coaching classes available?
Yes it is. You can contact me and visit my profile for Online classes
Abhishek
0 0
5
Is Python useful for learning?
Now days Python is very useful for data analytics and Development.
Venkata
Is learning Python good or bad?
Its depend on your requirement, I mean if you are seeking for good opportunity to move from one Org. to another, or migrating some applications into your project, or your manager are eagerly requesting...
Harish
0 0
7

is there an best online exam simulator for PCAP 31-02 python exam ?

yes, this will work Python exam in cisco net grade, it 's free and help in practice and if you clear this exam, you will get 50% off PCAP 31-02 exam coupon on your registered email id.
Rajgun
0 0
5
What is python software?
Python is a dynamic and interpreted programming language. It is good for shell scripting, web development using django,flask framework and lot of package for data science inbuild make it a all round programming...
Vikram

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Python- Basic Concepts part 2
1. Other Numerical Operations a. Exponentiation Besides addition, subtraction, multiplication, and division, Python also supports exponentiation, which is the raising of one number to the power of...


Why Do People Choose Python?
Lot of programming languages are available in the market today, but why do people choose python over them? What made it different from other scirpting languages. So factors made it unique, as below: Software...

Difference between Python 2.x and Python 3.x
Python 2.x and Python 3.x differs in following features: Division operator print function Unicode xrange Error Handling __future__ module

PEP (Python Enhancement Proposals)
Python Enhancement Proposals(PEP) are suggestions for improvements to the language, made by experienced Python developers. PEP 8 is a style guide on the subject of writing readable code. It contains a...

Recommended Articles

Python is one of the most popular programming languages in the world. It is general-purpose, object oriented, high-level programming language used in a number of programming fields. Python is a great programming language to learn as it will introduce you to the world of programming. If you are from the technical background...

Read full article >

Business Process outsourcing (BPO) services can be considered as a kind of outsourcing which involves subletting of specific functions associated with any business to a third party service provider. BPO is usually administered as a cost-saving procedure for functions which an organization needs but does not rely upon to...

Read full article >

Hadoop is a framework which has been developed for organizing and analysing big chunks of data for a business. Suppose you have a file larger than your system’s storage capacity and you can’t store it. Hadoop helps in storing bigger files than what could be stored on one particular server. You can therefore store very,...

Read full article >

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

Read full article >

Looking for Python Training classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for Python Training Classes?

The best tutors for Python Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Python Training with the Best Tutors

The best Tutors for Python Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more