Python RegEx

Python RegEx

12th Grade

10 Qs

quiz-placeholder

Similar activities

Ramayan and Shaktimaan Quiz (CC-BY-4.0)

Ramayan and Shaktimaan Quiz (CC-BY-4.0)

1st Grade - Professional Development

10 Qs

Alfred's Music theory

Alfred's Music theory

9th - 12th Grade

12 Qs

Undertale Characters: How well do you know it?

Undertale Characters: How well do you know it?

KG - Professional Development

11 Qs

Disney Characters

Disney Characters

KG - 12th Grade

9 Qs

Nov 28th Unit 1-3 Review

Nov 28th Unit 1-3 Review

9th - 12th Grade

13 Qs

Quiz No.5: String and Number Manipulation

Quiz No.5: String and Number Manipulation

11th Grade - University

15 Qs

String Methods Review

String Methods Review

9th Grade - University

10 Qs

Pixar: Pitching and Feedback

Pixar: Pitching and Feedback

6th - 12th Grade

12 Qs

Python RegEx

Python RegEx

Assessment

Quiz

Other

12th Grade

Easy

Created by

Amy Austin

Used 6+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a RegEx used for in programming?

To format strings in a specific way

To encrypt and decrypt data

To generate random strings

To check if a string contains the specified search pattern

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which module in Python is used to work with Regular Expressions?

os

re

math

json

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the findall() function in Python's re module do?

Returns a list containing all matches

Replaces one or many matches with a string

Searches for the first white-space character in the string

Splits the string at each match

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What character signifies the start of a string in RegEx?

*

$

^

.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which special sequence is used to find a digit in a string with RegEx?

\d

\s

\D

\w

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the RegEx metacharacter '.' match?

A non-digit character

A whitespace character

A digit

Any character except the newline character

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function is used to search for a match in a string, returning a Match object if there is a match?

split()

findall()

search()

sub()

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?