Regular Expression in Python

Regular Expression in Python

University

10 Qs

quiz-placeholder

Similar activities

Queen

Queen

4th Grade - University

9 Qs

gta san adres

gta san adres

KG - Professional Development

10 Qs

Saint Seiya Quiz

Saint Seiya Quiz

KG - Professional Development

10 Qs

Transportation and Commuting Quiz

Transportation and Commuting Quiz

University

14 Qs

Go Green - 2021

Go Green - 2021

1st Grade - University

10 Qs

General Smarts Quiz for my class

General Smarts Quiz for my class

KG - Professional Development

13 Qs

My Quiz

My Quiz

KG - Professional Development

15 Qs

No Morre Bystanders=No More Bullies

No Morre Bystanders=No More Bullies

KG - University

10 Qs

Regular Expression in Python

Regular Expression in Python

Assessment

Quiz

Other

University

Practice Problem

Hard

Created by

Shilpa Pande

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?