← All tools
// TEXT

Text Grep online

Filter text lines by a pattern — like grep in your browser. Supports regex.

Text Grep logo
by
CHUNKY
MUNSTER
Pattern:
TEXT INPUT0 LINES
MATCHING LINES0 LINES

About Text Grep

Works like the Unix grep command — filter lines of text by a pattern. Supports plain text and full JavaScript regular expressions. Use "Invert" to exclude matching lines instead. Runs entirely in your browser.

How to Use the Text Grep Tool

  1. Paste or enter your input into the text field.
  2. Configure any options (format, delimiter, encoding, or mode) using the controls above the output.
  3. The result updates instantly — no submit button required for most operations.
  4. Click Copy or Download to take the output to your next step.

Paste your input, type a search pattern, and choose whether to keep or exclude matching lines. The tool splits the input on newlines and runs each line through either a literal substring check or a JavaScript RegExp. Toggle the 'regex' switch to interpret the pattern as a regular expression instead of a literal string.

How the Text Grep Tool Works

JavaScript regex is close to PCRE but not identical — lookbehind is supported in modern browsers, but possessive quantifiers and recursive patterns are not. Case-insensitive matching uses the i flag. The match-count line tells you how many lines were kept versus filtered out, which is handy when grepping a large log dump for error keywords.

Frequently Asked Questions

What regex flavour does it support?

JavaScript RegExp — close to PCRE. Lookbehind, named groups and Unicode property escapes work in modern browsers. Possessive quantifiers and recursive patterns are not supported.

How do I invert the match (show non-matching lines)?

Switch to 'Exclude matching' mode — equivalent to grep -v. The output will contain every line that did not match your pattern.

Can I use a multi-line regex?

Patterns are applied per line, so ^ and $ anchor to the start and end of each line by default. To match across lines, you'd need to disable the line-split — currently this tool always splits on newlines.

Are matches case-insensitive by default?

No — matching is case-sensitive unless you toggle the 'ignore case' option, which adds the i regex flag.

Explore the full suite of TEXT tools and 290+ other free utilities at Chunky Munster.