Regex Quiz

Regex Quiz

12th Grade

9 Qs

quiz-placeholder

Similar activities

Java Quiz 1: Introduction

Java Quiz 1: Introduction

6th - 12th Grade

10 Qs

ArrayList

ArrayList

10th - 12th Grade

11 Qs

Parity

Parity

10th - 12th Grade

10 Qs

Python Data types

Python Data types

5th - 12th Grade

10 Qs

STRING MANIPULATION (PYTHON)

STRING MANIPULATION (PYTHON)

11th - 12th Grade

10 Qs

Variables & Data Types

Variables & Data Types

6th - 12th Grade

10 Qs

C++ Arrays

C++ Arrays

8th - 12th Grade

12 Qs

Java String class methods

Java String class methods

10th - 12th Grade

10 Qs

Regex Quiz

Regex Quiz

Assessment

Quiz

Computers

12th Grade

Hard

DOK Level 1: Recall

Standards-aligned

Created by

Tomas Martinez

Used 6+ times

FREE Resource

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the regex pattern `^a` match?

Any string that contains an 'a'

A string that starts with 'a'

Any string that ends with 'a'

None of the above

Tags

DOK Level 1: Recall

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which regex pattern matches any single digit?

`\d`

`\D`

`\w`

`\s`

Tags

DOK Level 1: Recall

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the regex pattern `abc?` mean?

Matches a string 'ab' followed by zero or more 'c'

Matches a string 'ab' followed by one or more 'c'

Matches a string 'ab' followed by zero or one 'c'

Matches exactly the string 'abc'

Tags

DOK Level 1: Recall

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In regex, what does the `*` character specify?

The preceding element must appear exactly once

The preceding element must not appear at all

The preceding element can appear zero or more times

The preceding element can appear one or more times

Tags

DOK Level 1: Recall

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which regex pattern would you use to find sequences of one or more whitespace characters?

`\s+`

`\S`

`\d+`

`\w+`

Tags

DOK Level 1: Recall

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the function of the `|` operator in regex?

Matches either the expression before or the expression after the operator

Matches the expressions both before and after the operator

Indicates the start of a capture group

None of the above

Tags

DOK Level 1: Recall

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which regex pattern matches any character except newline?

`\.`

`\n`

`.`

`^`

Tags

DOK Level 1: Recall

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the regex pattern `[a-z]` match?

Any lowercase letter between 'a' and 'z'

Any letter between 'a' and 'z'

The exact string 'a-z'

None of the above

Tags

DOK Level 1: Recall

9.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In regex, what does the `^` character inside square brackets (e.g., `[^a]`) signify?

Matches the beginning of the string

Matches the character 'a' at the beginning of the string

Does not match the character 'a'

Matches any character except 'a'

Tags

DOK Level 1: Recall