WorksheetsRegular Expressions
Total questions: 18
Worksheet time: 15mins
Which of these regular expressions matches a single-digit number?
\s
\d
\w
.
Which of these regular expressions matches a single letter?
\s
\d
\w
.
Which of these regular expressions matches an asterisk symbol (*)?
\s
\d
\w
.
Which regular expression matches a two-digit number?
\d{2}
\d+
\w{2}
..
Which regular expression matches a 5-letter word?
\w{5}
\w+
\d{3}\w\w
.*
Which regular expression matches a 7-letter or 8-letter word?
\w{7,8}
\w+
\w*
.*
Which of these regular expressions matches the text: "gs 8"?
\w+
\w\w\s\d
.+
[\w\s]{4}
A cell contains a number and some letters; which of the following RegEx functions can be used in Google Sheets to get that number?
REGEXEXTRACT
REGEXMATCH
REGEXREPLACE
The Find and Replace tool
You want to remove all spaces from a cell; which of the following RegEx functions can be used in Google Sheets to verify that?
REGEXEXTRACT
REGEXMATCH
REGEXREPLACE
The Find and Replace tool
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?
REGEXEXTRACT
REGEXMATCH
REGEXREPLACE
The Find and Replace tool
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?
REGEXEXTRACT
REGEXMATCH
REGEXREPLACE
The Find and Replace tool
Write the Regular expression that matches the cells containing the following:
"abc123"
"def456"
"ghi789"
(a)
Write the Regular expression that matches the cells containing the following:
"pencil#2"
"mambo#5"
"grade#8"
(a)
Which of the following regular expressions can be used to search for cells that start with a number?
\d
^\d
\d^
\d?
Which of the following regular expressions can be used to search for cells that end with an exclamation mark (!)?
$.*!
!
!$
\!$
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>"?
FIND: (\w+) (\w+)
REPLACE: $2, $1
FIND: (.*)(.*)
REPLACE: $2, $1
FIND: (\w+)\s(\w+)
REPLACE: $2, $1
FIND: (.*)\s(.*)
REPLACE: $2, $1
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)
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)
