
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
15 questions
BOSH Mod. 02 & 03
Quiz
•
University
10 questions
Safety Meeting Quiz Dec 2023
Quiz
•
University
10 questions
Testing Questions (ISTQB related)
Quiz
•
University
10 questions
Week 1: FOP
Quiz
•
University
10 questions
Cyber Security 101
Quiz
•
University
10 questions
Critical Approaches to Literature
Quiz
•
University
15 questions
Cartoons and Movies
Quiz
•
University
15 questions
Quiz No 01 (Pakistan Studies)
Quiz
•
University
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Other
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
20 questions
christmas songs
Quiz
•
KG - University
20 questions
Holiday Trivia
Quiz
•
9th Grade - University
15 questions
Holiday Movies
Quiz
•
University
14 questions
Christmas Trivia
Quiz
•
3rd Grade - University
20 questions
Christmas Trivia
Quiz
•
University
8 questions
5th, Unit 4, Lesson 8
Lesson
•
KG - Professional Dev...
20 questions
Disney Trivia
Quiz
•
University
