How number matching works here
The pattern -?\d+(?:\.\d+)? matches a run of digits, optionally preceded by a minus sign and optionally followed by a dot and more digits. So 42, -12, 3.14 and -0.001 all match. The minus must be directly attached to the digits with no space, otherwise it is treated as a hyphen.
Thousands separators are not understood. 1,234.56 becomes two matches: 1 and 234.56. If your data uses commas as thousands separators, run find and replace first to strip them. Conversely, in locales that use comma as the decimal separator (3,14), swap the comma for a dot before extracting.
Numbers embedded in identifiers are matched as separate fragments. v2.0.1 yields 2.0 and 1; ORDER-4821 yields -4821 because the hyphen is read as a sign. If you need stricter rules, switch to extract regex matches with a pattern of your own.
How to use extract numbers from text
- 1Paste your text into the input panel on the left.
- 2The output panel shows every number, one per line.
- 3Click Copy to copy the list.
- 4Click Download to save it as a plain-text file.
- 5For column-based or summed totals, paste the result into a spreadsheet.
Keyboard shortcuts
Drive TextResult without touching the mouse.
| Shortcut | Action |
|---|---|
| Ctrl F | Open the find & replace panel inside the input Plus |
| Ctrl Z | Undo the last input change |
| Ctrl Shift Z | Redo |
| Ctrl Shift Enter | Toggle fullscreen focus on the editor Plus |
| Esc | Close find & replace, or exit fullscreen |
| Ctrl K | Open the command palette to jump to any tool Plus |
| Ctrl S | Save current workflow draft Plus |
| Ctrl P | Run a saved workflow Plus |
What counts as a number here
Integers and decimals only
A run of digits with an optional dot-decimal tail. 42, 3.14, 0.001 all match. No scientific notation (1e6), no fractions (1/2), no leading-dot decimals (.5).
Optional leading minus
A minus sign directly attached to the digits is captured as part of the match. -12.4 stays -12.4. A hyphen with whitespace around it (page - 5) is not part of the number.
Thousands separators not parsed
1,234.56 matches as two values: 1 and 234.56. Strip commas with find and replace first if you want one match per number.
No currency or unit context
Symbols like $, %, °C, kg are not part of the match. $42.50 yields 42.50; -12.4°C yields -12.4. For currency-aware matching, use extract prices.
Embedded numbers split on dots beyond the first
Because the decimal tail is a single \.\d+, v2.0.1 matches as 2.0 then 1. Version strings split into their components; this is a feature when you are listing parts but a quirk when you want the full version.
Worked example
The currency symbol and units drop off, the negative on -12.4 is kept, and v2.0.1 splits into 2.0 and 1 because the decimal tail can only contain one dot.
Order #4821 totals $42.50 plus 7.5% tax. Temperature -12.4°C, wind 30 km/h. Version v2.0.1 ships 2026.
4821 42.50 7.5 -12.4 30 2.0 1 2026
Settings reference
| Behaviour | Effect on output |
|---|---|
| Integers | Captured as a run of digits. 42, 4821. |
| Decimals | Optional dot-decimal tail. 3.14, 0.001. |
| Leading minus | Captured if directly attached. -12.4 matches; page - 5 gives 5. |
| Thousands separators | Not parsed. 1,234.56 splits into 1 and 234.56. |
| Currency and units | Not part of the match. Use extract prices for currency. |
| Scientific and fractions | Not matched. 1e6 gives 1 and 6; 1/2 gives 1 and 2. |
FAQ
How do I extract numbers with thousands separators?
, with empty string for English-style commas, or with . for European-style decimal commas, then extract. For mixed European format (1.234,56: dot as thousands, comma as decimal) make two passes: first strip ., then swap , for .. For space-thousands (1 234.56) strip the spaces in one pass. The simple integer-plus-decimal pattern then captures the full value.Will 1e6 or 2^10 match as a single number?
1e6 gives 1 and 6; 2^10 gives 2 and 10. For scientific notation, use extract regex matches with a pattern like -?\d+(?:\.\d+)?(?:[eE]-?\d+)?.Why is -4821 captured from ORDER-4821?
\d+(?:\.\d+)?.