Text to filter

Filtered result

How does it work?

This tool filters lines in text based on a search pattern, similar to the Unix grep command. It keeps only the lines that match the specified pattern and discards the rest.

The filtering options include:

  • Case sensitivity: When enabled, matches must have the exact same case as the pattern
  • Regular expressions: When enabled, the pattern is treated as a regular expression for more powerful matching

Example

Original text:

The quick brown fox jumps over the lazy dog.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
This line contains FOX in uppercase.
Another line with the word "fox" in lowercase.
1234 - This line has numbers.
Regular expressions are powerful.
The pattern /^T/ matches lines starting with T.
The end.

Example 1: Filter lines containing "fox" (case insensitive)

The quick brown fox jumps over the lazy dog.
This line contains FOX in uppercase.
Another line with the word "fox" in lowercase.

Example 2: Filter lines containing "T" at the beginning (using regex ^T)

The quick brown fox jumps over the lazy dog.
This line contains FOX in uppercase.
The pattern /^T/ matches lines starting with T.

Regular Expression Tips

When "Use regular expressions" is enabled, you can use patterns like:

  • ^ - Match the beginning of a line (e.g., ^The matches lines starting with "The")
  • $ - Match the end of a line (e.g., end\.$ matches lines ending with "end.")
  • \d - Match any digit (e.g., \d+ matches one or more digits)
  • \w - Match any word character (letters, numbers, underscore)
  • .* - Match any characters (e.g., a.*z matches lines with "a" followed by any characters and then "z")

This tool is useful for:

  • Extracting specific information from logs or data files
  • Finding all lines containing a particular keyword
  • Filtering text based on complex patterns using regular expressions
  • Reducing large text files to only the relevant lines
  • Analyzing data by isolating lines that match specific criteria

Related Tools

All Tools

See all available tools