0
0
Google Sheetsspreadsheet~10 mins

REGEXMATCH and REGEXEXTRACT in Google Sheets - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the formula to check if cell A1 contains the word "cat".

Google Sheets
=REGEXMATCH(A1, [1])
Drag options to blanks, or click blank then click option'
A"cat"
B"dog"
C"bird"
D"fish"
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to put quotes around the pattern.
Using the wrong word in the pattern.
2fill in blank
medium

Complete the formula to extract the first number from cell B2.

Google Sheets
=REGEXEXTRACT(B2, [1])
Drag options to blanks, or click blank then click option'
A"[a-z]+"
B"\\d+"
C"\\s+"
D"[A-Z]+"
Attempts:
3 left
💡 Hint
Common Mistakes
Using letters instead of digits in the pattern.
Not escaping the backslash properly.
3fill in blank
hard

Fix the error in the formula to extract the domain from an email in cell C3.

Google Sheets
=REGEXEXTRACT(C3, [1])
Drag options to blanks, or click blank then click option'
A"@(.+)"
B"@(.+)$"
C"@(.+)\\..+"
D"@(.+\\..+)"
Attempts:
3 left
💡 Hint
Common Mistakes
Not including the dot in the domain pattern.
Using end-of-string anchor incorrectly.
4fill in blank
hard

Fill both blanks to create a formula that checks if cell D4 contains a 3-letter word starting with 'a'.

Google Sheets
=REGEXMATCH(D4, [1] & [2])
Drag options to blanks, or click blank then click option'
A"\\ba"
B"\\w"
C"\\b"
D"\\w{2}\\b"
Attempts:
3 left
💡 Hint
Common Mistakes
Not using word boundary \\b.
Using wrong quantifier for length.
5fill in blank
hard

Fill all three blanks to extract the area code (3 digits) from a phone number in cell E5 formatted like (123) 456-7890.

Google Sheets
=REGEXEXTRACT(E5, [1] & [2] & [3])
Drag options to blanks, or click blank then click option'
A"\\("
B"(\\d{3})"
C"\\)"
D"\\s"
Attempts:
3 left
💡 Hint
Common Mistakes
Not escaping parentheses.
Using wrong number of digits in the pattern.