Test multiple strings
Multiple test strings let you compare separate inputs with one pattern. Each input has its own result.
- Free
- Included: two test strings
- 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 tabs.
- Enter another input.
- Repeat for the cases that exercise different behavior.
- Change the pattern and compare the results across the inputs.
Hover over a tab to reveal Tab actions (⋮). Select it to open the tab menu. You can also right-click the tab.
To use a file as an input, follow Load files.
The inputs use the same pattern and flags. Results update when the editor runs the pattern against each input.
Compare matching and nonmatching inputs
Use JavaScript, no flags, and this pattern:
^ORD-[0-9]{4}$
Compare these matching and nonmatching inputs:
| 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 compares order and invoice identifiers in four input tabs.
- Inspect the matching order and the rejected short identifier.
- Change the prefix to
(?:ORD|INV)while keeping[0-9]{4}. - Compare the order and invoice results across the tabs.
- Verify that the short identifier still has no match.
An example link can open the pattern and one input. Use the table to create the remaining separate inputs.
Use inputs with AI Assistant
To share examples with AI Assistant, select them under Attachments > Test strings. Edit their content in the editor. Your next request uses the updated text.
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.
Multiple test strings show results. Unit tests add explicit expectations that can pass or fail.