Valid Phone Numbers
Lesson 26 of 28 in Coddy's RegEx in Python course.
Challenge
EasyWrite a function named find_phone_numbers that takes a text string as input and returns a list of valid phone numbers. A valid phone number is in the format (XXX) XXX-XXXX where X is a digit.
Try it yourself
import re
def find_phone_numbers(text):
# Write code hereAll lessons in RegEx in Python
1Introduction
Introduction7Final Challenges
Extracting HashtagsFinding Email AddressesValid Phone NumbersFinding DatesCapitalized Words