EditSafely

Create ASCII from Regex

Generate a random ASCII string that matches a regex pattern.

Runs on your device, nothing uploaded

How many strings
Limit for * and +
The most repeats an open-ended * or + may produce.
Try:

0 chars · 0 lines

Output

Generate a random ASCII string that matches a regex pattern.

Type or paste above to see the result here.

Example: Number plate (one possible result)

What you paste never leaves this tab

Create ASCII from Regex is JavaScript that your browser has already downloaded, and it does the whole job on your own machine. On a normal site, the text you paste 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 Create ASCII from Regex

  1. 1. Type a pattern or tap an example. Type a regular expression such as [A-Z]{3}-\d{4} into the one-line field, or tap an example: a number plate, a phone number, a hex ID, (cat|dog)s? or an email address.
  2. 2. Pick how many strings. Tap 1, 5, 10, 50 or 100, or type any count up to 1,000. Each string goes on its own line. Under More options, Limit for * and + caps how long open-ended repeats can grow.
  3. 3. Press New for fresh samples. Every string matches your pattern. Press New to draw a different set. If the pattern has a mistake, such as an unclosed [, the message says where it is and how to fix it.
  4. 4. Copy the strings. Copy the list and drop it into your test suite, fixtures or sample data.

When to use Create ASCII from Regex

Create ASCII from Regex runs a regular expression backwards, generating random strings that match a given pattern instead of matching a pattern against existing text. It is useful whenever you need realistic sample data that must satisfy a specific format like a fixed character class or length.

  • Generating test fixtures for a validation regex. You wrote a regex to validate usernames or product codes and need sample valid inputs for your unit tests. Generating several matching strings here gives you ready made fixtures without inventing them by hand.
  • Producing sample data for a form field. A form field enforces a pattern like three letters followed by four digits and you need example values for a demo or design mockup. Generating matches here produces believable looking sample data instantly.
  • Fuzzing a parser with valid inputs. You're testing a parser or state machine and want a batch of inputs that are guaranteed valid according to its grammar. Generating many matches for the pattern gives you varied valid test cases quickly.
  • Checking that a regex isn't too restrictive. You suspect a regex is more restrictive than intended and want to see the range of strings it actually allows. Generating several examples shows the real space of matching strings.

Examples

Number plate

Input

[A-Z]{3}-\d{4}

One possible result

QKR-4821

Phone number

Input

\d{3}-\d{3}-\d{4}

One possible result

415-555-0192

Hex ID

Input

[a-f0-9]{8}

One possible result

3fa9c01e

Cats or dogs

Input

(cat|dog)s?

One possible result

dogs

Email address

Input

[a-z]{5,10}@example\.com

One possible result

qwhfmz@example.com
brtlsoep@example.com
kdjeu@example.com

About the Create ASCII from Regex tool

Create ASCII from Regex is a free online tool that works entirely inside your web browser. Generate a random ASCII string that matches a regex pattern. Because the processing happens on your own device, nothing you enter is uploaded, logged or stored anywhere.

This page is one of 81 ASCII utilities on EditSafely. Each one does a single job well, and all of them follow the same rule: your input stays on your machine.

You can shape the output with 2 settings, including How many strings and Limit for * and +, and the result refreshes the moment you change one. 5 worked examples further down the page show exactly what the tool produces for real inputs.

Because nothing leaves your device, the tool is suitable for sensitive content such as internal documents, credentials or customer data. It also responds instantly, since every step is handled on your own machine rather than by a remote API.

Frequently asked questions

Does Create ASCII from Regex cost anything?

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?

No data leaves your device. The whole tool is JavaScript that runs inside your browser tab, so there is no upload, no server-side processing and no log of what you did. If you disconnect from the internet after the page loads, it keeps working.

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?

Nothing to install and no account needed. Open the page in any up-to-date browser, including on a phone or tablet, and the tool is ready.

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.

Related tools

All ASCII Tools →