g (all matches), i (ignore case), m (multiline), s (dotall). For Bash mode, m/s don’t map 1:1.m if you want ^/$ to act per-line (JS behavior).[[ $s =~ regex ]], don’t put the regex in quotes unless you want a literal string match.
How to use
Quick workflow:
- Select Mode (Bash
[[ =~ ]]orgrep -E). - Enter a Regex and your Input text.
- Click Test to list matches and groups (add flag
gto list all). - Optionally enter a Replacement and click Replace.
- Use Generate snippet to copy a Bash/grep example.
FAQ
Is this an exact Bash [[ =~ ]] engine?
No—matching runs with your browser’s regex engine; the tool focuses on fast debugging and snippet generation, with warnings where Bash/ERE commonly differs.
Why does my Bash regex fail when I put it in quotes?
In [[ $s =~ regex ]], quoting the regex turns it into a literal string comparison; generally leave the regex unquoted.
Does grep -E support \d or \w?
No; POSIX ERE uses character classes like [0-9], [[:alpha:]], and [[:alnum:]].
How do I get capture groups in Bash?
After [[ $s =~ re ]], use ${BASH_REMATCH[0]} for the full match and ${BASH_REMATCH[1]}, [2], etc. for groups.
Why do I only see one match?
If you don’t use flag g, the tool shows the first match only; add g to list all matches.
Can I test multiline patterns here?
Yes; paste multiple lines and use m for JS-style multiline behavior, but note Bash/grep may handle newlines differently.
Is my text uploaded anywhere?
No; everything runs locally in your browser and this tool does not make network requests.