Filter numbers in a list

Three modes for working with numbers inside a list. Numbers only (default) extracts every number from every line, one per output line. Lines with keeps lines containing at least one matching number. Drop numeric lines removes lines that are entirely a number. Optional Min/Max range, decimals and negatives toggles.

Input
Ready
Output
Live

Three number-filtering modes with range + shape toggles

Output mode decides the shape. **Numbers only** (default) runs a global regex over every line and emits every number it finds - one per output line. A line like `Order 42 for $100` with numbers-only mode produces two output lines: `42` and `100`. **Lines with** keeps the original line if it contains at least one matching number. **Drop numeric lines** removes lines that are entirely a number; prose stays.

Min / Max gate numeric values. Leave blank for no range (infinite on that side). Only numbers whose value is within `[Min, Max]` count as matches. In Numbers only mode this filters the extracted list. In Lines with mode a line must contain at least one number in range.

Allow decimals (on by default) and Allow negatives (on by default) control the number-shape regex. Turn them off to make `3.14` or `-5` fail the pattern - useful when your "numbers" are always positive integers and you want to exclude formulas or signed values.

How to use filter numbers in a list

  1. 1Paste your list into the input panel
  2. 2Pick Output mode: Numbers only (default) / Lines with / Drop numeric lines
  3. 3Leave Min / Max blank for no range, or type a value to gate by numeric size
  4. 4Toggle Allow decimals / Allow negatives to narrow the number shape accepted
  5. 5Output runs live - no apply button

Keyboard shortcuts

Drive ListShift without touching the mouse.

Shortcut Action
Ctrl ZUndo last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor
EscExit fullscreen
Ctrl KOpen the command palette to jump to any tool
Ctrl SSave current pipeline draft Plus
Ctrl PRun a saved pipeline Plus

What this filter actually does

Regex extraction / line filter with range and shape controls.

Numbers only: extract every matching number

Default mode. Each line is scanned globally; every number matching the shape and range is emitted on its own line. Great for pulling prices, IDs, or counts out of mixed prose.

Lines with: filter containing-a-number

Keeps a line if at least one number in it matches the shape and range. `Order 42 for $100` survives if `42` or `100` is in range; it drops if neither is.

Drop numeric lines: keep prose only

Inverse of the `detect_types` numeric check: lines that are entirely a number (trimmed) are dropped. Useful when prose is the signal and numbers are noise (log levels, IDs, empty rows of numbers).

Min / Max bounds

Leave blank to skip that side (-∞ / +∞). `Min = 0` drops every negative. `Max = 100` drops everything above 100. Applies to every matched number in Numbers only, to any-match-satisfies in Lines with.

Number-shape toggles

Allow decimals off means the regex only captures integer runs - a line like `7.8` splits into two matches (`7` and `8`) rather than one decimal. Allow negatives off drops the leading `-` from the match pattern, so `-3` captures as `3`. Use these when your data is always whole-number and you want decimals / signs treated as non-numeric separators.

Worked example

Default Numbers only mode, no range set, decimals + negatives on. Every number in the input passes through.

Input
5
-3
7.8
10
-1.5
20
Output
5
-3
7.8
10
-1.5
20

Settings reference

How each option shapes the output using the sample above.

Setting What it does Effect on the sample
Output: Numbers only (default), no range Extracts every number, no filtering All 6 numbers pass through
Output: Numbers only, Min: 0, Max: 10 Keeps numbers where 0 ≤ v ≤ 10 `5`, `7.8`, `10` (negatives and 20 dropped)
Output: Drop numeric lines Drops lines that are entirely a number Every line gone - sample is all-numeric
Allow decimals: off Only the integer parts match - decimals split on the `.` `7.8` becomes two matches (`7`, `8`); `-1.5` becomes `-1`, `5`
Allow negatives: off Leading `-` is not part of the match `-3` matches as `3`; `-1.5` as `1`, `5` (with decimals off)

FAQ

What is the difference between Numbers only and Lines with?
Numbers only extracts the numbers themselves, one per output line - you lose the surrounding text. Lines with keeps the full line (with its surrounding text) if at least one number matches. Pick extract when you want the values; pick lines-with when you want the context.
What happens when Min and Max are both blank?
No range filtering - any number that passes the shape check (decimals / negatives toggles) counts as a match. Fill either side to add a bound on that side; leave the other blank for open-ended.
Does Drop numeric lines use Min / Max?
No - it drops a line iff the whole line is numeric by shape. The range bounds only apply to Numbers only and Lines with modes.
Can I keep only integers?
Yes - turn off Allow decimals. `3.14` and `-1.5` will fail the shape check before the range test runs.
What is the opposite of this?
Counting rather than filtering: Detect numeric and text items reports how many lines are numeric vs text without filtering the content.