Generate Integers From a Regex
Enumerate every integer matched by a simple regex. Runs entirely in your browser, so your data never leaves your device.
Runs on your device, nothing uploaded
0 chars · 0 lines
Output
Enumerate every integer matched by a simple regex.
Type or paste above to see the result here.
What you paste never leaves this tab
Generate Integers From a Regex is JavaScript that your browser has already downloaded, and it does the whole job on your own machine. On a normal site, whatever you type in is sent to a server that can log it, cache it or keep it. Here it is read and transformed inside this tab and nowhere else.
- No upload
- No length limit
- Works offline once loaded
- Nothing stored or logged
How to use Generate Integers From a Regex
- 1. Paste a simple pattern. Enter a digit regex, such as \d{2}, [1-3], (19|20)\d{2} or 1[0-2]?. Quantifiers like {2}, {1,3}, ? work; + and * stop at 3 repeats with a note.
- 2. Set the result limit. Pick a Max results chip (100, 1,000 or 10,000). The note says how many numbers match in total, such as 1,000,000 for \d{6}, before the first ones are listed.
- 3. Copy the enumerated integers. Copy the full list of integers the pattern expands into, one per line, ready to paste into a script or test fixture.
When to use Generate Integers From a Regex
Generate Integers From a Regex expands a simple regular expression into every whole number it can match, instead of leaving you to work out the matches by hand. Use it to turn a compact pattern into a concrete list of test values.
- Building test cases for a regex. You wrote a validation regex meant to match a specific digit range or format and want to see the exact set of integers it accepts before deploying it.
- Generating a small enumerated dataset. A form field only accepts integers matching a narrow pattern, like a two-digit code starting with a certain digit, and you want the full list to populate a dropdown.
- Teaching regex character classes. A tutorial explains how digit ranges like [1-3] work in regular expressions. Expand the pattern here to show the concrete numbers it produces.
- Verifying pattern coverage before a code review. You want to confirm a teammate's regex for validating numeric IDs actually matches the range they intended, by enumerating what it accepts.
Examples
A digit range
Input
[1-3]
Output
1 2 3
Alternation and a literal digit
Input
(1|2)0
Output
10 20
About the Generate Integers From a Regex tool
Generate Integers From a Regex runs as plain JavaScript in your browser tab, with no server behind it. Enumerate every integer matched by a simple regex. Whatever you put in stays on your device from start to finish.
The tool is part of EditSafely's Integer Tools section, 133 single-purpose utilities built around the same idea: open the page, get the result, keep your data to yourself.
You can shape the output with the Max results setting, and the result refreshes the moment you change it. 2 worked examples further down the page show exactly what the tool produces for real inputs.
That local-first design has practical benefits beyond privacy. The tool keeps working on a flaky connection once the page has loaded, results are instant because nothing round-trips to a server, and it is safe to use with confidential material.
Frequently asked questions
Is Generate Integers From a Regex free to use?
Yes, it is completely free. All 2,943 tools on EditSafely work without an account, a subscription or usage limits.
Is it safe to paste sensitive or confidential data?
Everything happens locally. Your browser downloads the tool's code once, then does all the processing itself; nothing you enter is transmitted, stored or logged. You can even go offline after the page loads and it will still work.
How much text can I process at once?
There is no fixed limit; your device's memory is the ceiling. Up to 10 MB the result updates as you type, after a short pause that grows with the size. Above 10 MB a Run button appears so typing stays smooth, and files open up to 50 MB. A very long result shows its first 2,000 lines on screen, while Copy and Download always include all of it.
Do I need to sign up or install anything?
No. The tool works in any modern browser on desktop, tablet or phone. There is no account to create, no extension to add and no software to install.
How do I use the result?
The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.