
Regular Expression in Python
Quiz
•
Other
•
University
•
Practice Problem
•
Hard
Shilpa Pande
Used 2+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which module in Python supports regular expressions?
re
regex
pyregex
none of the mentioned
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following creates a pattern object?
re.create(str)
re.regex(str)
re.compile(str)
re.assemble(str)
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the function re.match do?
matches a pattern at the start of the string
matches a pattern at any position in the string
such a function does not exist
none of the mentioned
4.
FILL IN THE BLANK QUESTION
30 sec • 1 pt
____________ character is used to represent zero or more occurrences of the preceding character in a regular expression
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
import re
pattern = r'\d+'
result = re.findall(pattern, 'The price is $25 and $50')
print(result)
['25', '50']
['$25', '$50']
['The', 'is', 'and']
[ ]
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the re.search() function in Python?
Searches for a pattern at the end of a string
Searches for a pattern anywhere in a string
Searches for a pattern at the beginning of a string
Searches for a pattern case-insensitively
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In a regular expression, what does [a-zA-Z] represent?
Matches any single character
Matches any lowercase letter
Matches any uppercase letter
Matches any letter
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
FunWithCSW
Quiz
•
University
10 questions
Environmental Education and Sustainability Initiative Quiz
Quiz
•
University
10 questions
Room status code
Quiz
•
11th Grade - Professi...
15 questions
Review Respiratory, Infection, Pain
Quiz
•
University
15 questions
QUIZ 2: Fundamental Concepts of IAS 2
Quiz
•
University
10 questions
Guess That Game!
Quiz
•
4th Grade - Professio...
15 questions
Goosebumps
Quiz
•
1st Grade - Professio...
12 questions
CMA I - Intro & Cost Classification
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Other
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
5 questions
Poetry Interpretation
Interactive video
•
4th Grade - University
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...
15 questions
Review1
Quiz
•
University
15 questions
Pre1
Quiz
•
University
