Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Regular Expressions

Total questions: 18

Worksheet time: 15mins

Name
Class
Date
1.

Which of these regular expressions matches a single-digit number?

a)

\s

b)

\d

c)

\w

d)

.

2.

Which of these regular expressions matches a single letter?

a)

\s

b)

\d

c)

\w

d)

.

3.

Which of these regular expressions matches an asterisk symbol (*)?

a)

\s

b)

\d

c)

\w

d)

.

4.

Which regular expression matches a two-digit number?

a)

\d{2}

b)

\d+

c)

\w{2}

d)

..

5.

Which regular expression matches a 5-letter word?

a)

\w{5}

b)

\w+

c)

\d{3}\w\w

d)

.*

6.

Which regular expression matches a 7-letter or 8-letter word?

a)

\w{7,8}

b)

\w+

c)

\w*

d)

.*

7.

Which of these regular expressions matches the text: "gs 8"?

a)

\w+

b)

\w\w\s\d

c)

.+

d)

[\w\s]{4}

8.

A cell contains a number and some letters; which of the following RegEx functions can be used in Google Sheets to get that number?

a)

REGEXEXTRACT

b)

REGEXMATCH

c)

REGEXREPLACE

d)

The Find and Replace tool

9.

You want to remove all spaces from a cell; which of the following RegEx functions can be used in Google Sheets to verify that?

a)

REGEXEXTRACT

b)

REGEXMATCH

c)

REGEXREPLACE

d)

The Find and Replace tool

10.

A certain cell must contain only letters but no numbers; which of the following RegEx functions can be used in Google Sheets to verify that?

a)

REGEXEXTRACT

b)

REGEXMATCH

c)

REGEXREPLACE

d)

The Find and Replace tool

11.

In a large spreadsheet you want to look for the cell which contains your name; which of the following RegEx functions can be used in Google Sheets to verify that?

a)

REGEXEXTRACT

b)

REGEXMATCH

c)

REGEXREPLACE

d)

The Find and Replace tool

12.

Write the Regular expression that matches the cells containing the following:

"abc123"

"def456"

"ghi789"

(a)  

13.

Write the Regular expression that matches the cells containing the following:

"pencil#2"

"mambo#5"

"grade#8"

(a)  

14.

Which of the following regular expressions can be used to search for cells that start with a number?

a)

\d

b)

^\d

c)

\d^

d)

\d?

15.

Which of the following regular expressions can be used to search for cells that end with an exclamation mark (!)?

a)

$.*!

b)

!

c)

!$

d)

\!$

16.

A column contains the name of a person in the format "<first name> <last name>", which of these Find and Replace tools can be used to modify those cells to contain "<last name>, <first name>"?

a)

FIND: (\w+) (\w+)

REPLACE: $2, $1

b)

FIND: (.*)(.*)

REPLACE: $2, $1

c)

FIND: (\w+)\s(\w+)

REPLACE: $2, $1

d)

FIND: (.*)\s(.*)

REPLACE: $2, $1

17.

In your "clients" spreadsheet you store the name of the customers of your business. A customer just changed his name from "Greg" to "Max". Write the regular expression function that accomplishes this.

(a)  

18.

In the same "clients" spreadsheet you have besides the name of the client cells that store the phones of your customers in the format "Phone <number>". Write a regular expression function that gets you only the number. The first cell that contains such values is B2.

(a)