We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
Was this tool helpful to use?
Your feedback helps us make it better
An online regex tester designed for Go developers. Validate RE2 syntax rules and view match results and capture groups in real-time.
i
m
s
Enter both a regex pattern and input text
Overview
Understand what the tool solves, how it works, and the boundaries of its data.
Enter a pattern and sample text to see highlighted matches, match count, full match values, and capture groups. The page also has a replacement mode that previews changed text; a control determines whether replacement applies to every match or only the first. Although the page is titled for Go, its active matching behavior uses JavaScript’s RegExp. A result here does not certify that a pattern compiles or behaves the same in Go’s regexp package.
The available switches are ignore case (i), multiline (m), and dot-all (s). Multiline is on by default; ignore case and dot-all are off. In JavaScript, m changes how ^ and $ treat line boundaries, while s lets a dot match line terminators. Match positions are JavaScript string indices, not Go UTF-8 byte offsets.
Guide
Follow the workflow and verify inputs and outputs with practical examples.
Use a short sample with realistic line breaks. For example, ([A-Z]{2})(\d{3}) against Order AB123 shows the full match and two capture groups.
Match mode highlights hits and lists details. Replacement mode also accepts replacement text; with replace-all on, every occurrence is changed, and with it off only the first is replaced.
Toggle case-insensitive, multiline, or dot-all behavior to match the JavaScript use case you are checking. Since multiline starts enabled, turn it off when line anchors should apply only to the entire input.
Check count, highlighted text, group values, positions, and replacement preview. If the destination is Go, run a test with Go’s standard library before relying on the pattern.
Use cases
See how the tool fits into real work and everyday tasks.
Try a fictional ID such as AB123 and inspect whether each subgroup captures the intended letters and digits.
Use a non-sensitive excerpt to compare match highlighting with replacement output, and confirm whether one or all occurrences should change.
Test a pattern with ^ against a multi-line sample, then toggle multiline to observe how line boundaries affect matches.
Q&A
Find concise answers to common questions and confusing cases.
No. The page executes JavaScript RegExp. Go’s standard library has its own syntax and behavior; use a Go test for final verification.
It enables JavaScript’s m flag, so start and end anchors can match line boundaries within the input. It is enabled by default.
The displayed index comes from JavaScript string matching and counts UTF-16 code units. Go string indexing commonly reports byte offsets, so non-ASCII text can yield different numbers.
Switch to replacement mode and turn off the replace-all option. The preview then applies the pattern without the global flag.
Notes
Review scope, result limitations, and important precautions before use.
Because matching runs under JavaScript rules, unsupported syntax or differences in flags, Unicode handling, anchors, and replacement tokens can make results differ from a Go program. A successful browser match is not a Go compatibility check, and it does not establish safety or performance for every input. Verify the final expression in the exact target runtime with representative tests. Avoid pasting credentials, personal information, or unredacted production logs.
Related
Discover related tools, collections, and available API capabilities.