Search Header Logo

Python RegEx

Authored by Amy Austin

Other

12th Grade

Used 7+ times

Python RegEx
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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()

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?