All tools / Data

Regex cheatsheet tester

Test JavaScript / grep / sed-style regular expressions against sample text with a POSIX vs PCRE cheatsheet.

Matches


  

bash / grep / sed notes

ConstructJS / PCREgrep -E / sed -Egrep (BRE) / sed
Any char...
One or more++\+
Optional??\?
Group(ab)(ab)\(ab\)
Ora|ba|ba\|b
Word chars\woften [[:alnum:]_]same classes
ReplaceJS replacesed -E 's/foo/bar/g'
grep EREgrep -E 'foo|bar' file · GNU grep -P is PCRE if built in