A supporting tool from the Orthogonal blog
RegexLab is a browser-based place to try JavaScript regular expressions against examples. Its multi-case view is useful when turning an explanation into explicit should-match and should-not-match cases.
When it fits
Test and debug regular expressions against sample text.
JavaScript regex, flags g/i/m/s/u/d, replacement, capture groups, test cases, and a pattern library.
Start with a small example
- Start with a short pattern and sanitized sample text.
- Choose the flags you need and inspect matches or replacement output.
- Add both positive and negative test cases before moving the expression into application code.
Limits to understand
JavaScript regular expressions are not interchangeable with every server-side regex engine. Matching a few examples is not proof of correctness or safe runtime on arbitrary input. Avoid experimenting with long adversarial strings in a production browser session, and check the application's own runtime separately.
Input processing and privacy
Inspected code keeps patterns and samples in the browser and localStorage. Cloudflare Analytics still loads.
Local processing is not a promise of zero network requests. Read the privacy policy and use non-sensitive examples unless you have independently reviewed the application.
Related reading
This introduction describes the public tool and its limitations, not an independent security certification. Check the current application for available controls. Return to all blog articles when you are done.