Test multiple strings
Multiple test strings keep distinct inputs beside one pattern. Each input has its own result, so an empty string remains a separate case.
- Free
- One test string
- Pro
- Included
- Self-hosted
- Included
Add inputs
- Enter your pattern and select its engine and flags.
- Enter the first input in the test string editor.
- Select Add test string beside the input area.
- Enter another input.
- Repeat for the cases that exercise different behavior.
- Change the pattern and compare the results across the inputs.
The inputs use the same pattern and flags. Match results update as the editor runs the pattern against each input.
Compare matching and nonmatching inputs
Use JavaScript, no flags, and this pattern:
^ORD-[0-9]{4}$
Create one test string for each row:
| Input | Expected result | Purpose |
|---|---|---|
ORD-0042 | One full match | Order format |
ORD-9999 | One full match | Four digits |
ORD-42 | No match | Too few digits |
ORD-00420 | No match | Too many digits |
XORD-0042 | No match | Unexpected prefix |
| Empty string | No match | Missing input |
The demonstration uses three inputs: ORD-0042, ORD-42, and ORD-0187. Switching tabs shows each input's separate result.
- Select Input 1 to inspect the match for
ORD-0042. - Select Input 2 to verify that
ORD-42has no matches. - Add Input 3 with
ORD-0187. The four-digit identifier matches. - Change the pattern to
^ORD-[0-9]{2,4}$and select Input 2. NowORD-42matches too.
The last change accepts two, three, or four digits. Restore {4} if your identifiers must contain exactly four digits.
The pattern is shared across all three inputs.
An example link can open the pattern and one input. Use the table to create the remaining separate inputs.
Save the test set with the workspace
Save the workspace to keep the pattern and its test strings together. Reopening that workspace restores the collection.
Sharing also includes the saved inputs. Use synthetic examples or remove sensitive text before creating a shared version.
Access and practical limits
Free supports one editable test string. A saved workspace with multiple test strings becomes read-only without the required feature access.
With Free, you can paste these inputs into the same editor one at a time. Keep the empty string as a separate run.
Each input runs under the configured execution timeout. Large collections also use more browser memory.
Multiple test strings show results. Unit tests add explicit expectations that can pass or fail.