How to use the Regex Generator.
A regex needs both matching and nonmatching examples. Specify the runtime and whether the pattern must match a whole value or a substring.
Make the workflow fit your task.
Specify the regex engine, matching scope and representative positive and negative strings. Build the smallest pattern that expresses the rule, then execute the examples in that engine before treating the pattern as validated.
- What you provide
- Matching requirements and representative strings.
- What you get
- Regex with positive and negative test examples.
See the input and the result.
Illustrative input and output · a teaching example, not a live WebAct run
Example input
JavaScript pattern for exactly three uppercase ASCII letters followed by two digits.
Completed example
^[A-Z]{3}[0-9]{2}$ matches ABC12 and rejects AB12, abc12 and ABC123.Load this input into the prompt, then copy it to WebAct to try the task. Your result may differ from the illustration.
Decisions and troubleshooting.
Should a validation pattern match a substring or the whole input?
State the requirement explicitly. Use appropriate boundaries for whole-input validation and test leading or trailing extra characters.
Why does a pattern work in a tester but fail in my application?
Compare engine, flags and string escaping. The application may receive a different pattern or input than the testing interface.
Reference for this workflow.
Try it with your own source.
Replace the example with your material in the task prompt. Keep the requirements you need, then copy the task into WebAct.
Customize and copy the task ↑