Filter Lines Like grep
Keep or remove lines that match a pattern, with regex or plain text, case-insensitive matching, context lines, only-matching output and the equivalent grep flags.
Free · No sign-up · Your inputs stay in your browser
Input
Filter lines like grep
Output
Matching lines
3 of 5 lines. Equivalent: grep -iE 'ERROR|WARNING'
The equivalent grep flags are shown above the output. On large files ripgrep (rg) is much faster, and it skips binary files and .gitignore'd paths by default. JavaScript regex syntax here is close to grep -E, but \d works here and needs grep -P on GNU grep.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
grep flags, side by side
-v inverts, -i ignores case, -F treats the pattern as plain text, -E uses extended regex, -o prints only the match and -C n adds context. The output names the combination you chose, so the same filter can be run on the full file on the server. The GNU grep manual documents them.
Regex flavours
This page uses JavaScript regex, which is close to grep -E. Shorthands such as \d are not in POSIX extended regex: GNU grep needs -P for them, and macOS grep does not support -P at all.