FxFormula Drills

Premium Google Sheets drill · Text and regular expressions

REGEXEXTRACT an order id

Practice Google Sheets REGEXEXTRACT to pull the digits from an order note. The capture comes back as text.

A2 says Order 1842 ready. REGEXEXTRACT returns the first capture group as text, even when the characters are digits.

In B2, extract the digits from A2.

Dataset

Starter sheet. Cells marked formula are where the formula goes.

Starter sheet for this exercise
RowAB
1Note
2Order 1842 readyFormula goes in B2. formula

Hint

A capture group is parentheses around \\d+ inside the pattern string.

Explanation

The pattern (\d+) captures 1842. REGEXEXTRACT returns that group as text, so a leading zero in another id would stay a zero.

The interactive sheet and a worked solution are part of Formula Drills Premium. The instructions and starter data on this page are the full problem.

Solve this drill

Practice this formula

Loading the practice grid…

Google Sheets is a trademark of Google LLC. Formula Drills is not affiliated with Google. Excel drills on this site are a separate track.