Skip to main content
Filter Text Lines by Pattern or Regex

Filter Text Lines by Pattern or Regex

Filter and extract text lines by pattern or regex. Supports regex patterns, case-sensitive matching, and line-by-line filtering. Perfect for log analysis.

About Filter Text Lines


Filter text lines based on a pattern or regular expression. This tool helps you quickly extract lines that match specific criteria, whether you're searching for simple text patterns or using advanced regular expressions. Useful for log analysis, data extraction, and text processing tasks.

Features


The Filter Text Lines tool provides the following features:

  • Pattern Matching - Match lines containing specific text patterns.
  • Regular Expression Support - Use powerful regex patterns for complex matching rules.
  • Case Sensitivity - Choose whether to match case exactly or ignore case differences.
  • Line-by-Line Filtering - Process text line by line, returning only matching lines.
  • Easy to Use - Simply enter your text, specify the pattern, and filter with a single click.
  • Preserve Line Structure - Maintains the original line breaks in filtered results.

Examples


  • Simple Text Pattern
    Input:
    Line 1: Error occurred
    Line 2: Success
    Line 3: Error in module
    Line 4: Completed
    
    Pattern: Error
    Use Regex: No
    Case Sensitive: No
    
    Output:
    Line 1: Error occurred
    Line 3: Error in module
  • Regex Pattern - Starts with Capital
    Input:
    apple
    Banana
    cherry
    Date
    
    Pattern: ^[A-Z]
    Use Regex: Yes
    Case Sensitive: Yes
    
    Output:
    Banana
    Date
  • Regex Pattern - Contains Numbers
    Input:
    Version 1.0
    No numbers here
    Update 2.3.4
    Text only
    
    Pattern: \d+
    Use Regex: Yes
    Case Sensitive: No
    
    Output:
    Version 1.0
    Update 2.3.4
Text Tools
Other tools you might like
Replace Commas in Text
Replace commas in text with another symbol, keep commas in numbers, and optionally collapse comma clusters.
Remove Text Letters
Remove selected letters from text, optionally match case exactly, and clean repeated spaces afterward.
Remove Text Font
Convert fancy Unicode text styles into regular Latin text and optionally preserve selected symbols.
Remove Quotes from Words
Remove quote marks from the beginning and end of individual words, with optional multi-level quote deletion.
Remove Quotes from Text
Remove outer quote marks from text, optionally unquote line by line, trim whitespace, and strip repeated quote layers.
Remove Quotes from Lines
Remove quote marks from the beginning and end of text lines, clean multiple quote layers, and trim leftover whitespace.
Remove Empty Text Lines
Remove empty lines from text and optionally delete lines that contain only tabs or spaces.
Remove Duplicate Words from Text
Remove duplicate words from text, keep first copies or delete all repeats, and choose the output word delimiter.
Randomize Text Spacing
Randomize spaces in text and optionally vary tabs and newlines with configurable minimum and maximum ranges.
Printf Text
Format text with a printf-style template, optionally formatting each line separately and decoding escape sequences.
Highlight Words in Text
Highlight whole words and phrases in text with word-boundary matching, optional case sensitivity, and custom colors.
Highlight Sentences in Text
Highlight whole sentences that contain selected patterns or exactly match target sentence text, with custom colors.
Highlight Regexp Matches in Text
Highlight matches for one or more regular expressions with custom default flags and configurable marker colors.
Highlight Patterns in Text
Highlight repeated text patterns and substrings with optional case-sensitive matching and customizable marker colors.
Highlight Letters in Text
Highlight specific letters or symbols inside text with optional case-sensitive matching and custom marker colors.
Generate Zalgo Text
Generate glitchy Zalgo text by adding combining marks above, through, and below characters with controllable chaos levels.
Generate Text Skip-Grams
Generate k-skip-n-grams from text, choose word or letter mode, control sentence edges, and customize separators or punctuation cleanup.
Generate Text of Certain Length
Generate random text with an exact number of characters from preset or custom character pools, with optional line wrapping.
Generate Text N-Grams
Generate word or letter n-grams from text, choose the size n, respect sentence endings if needed, and optionally normalize punctuation or case.
Generate Text from Regex
Generate random strings from a regexp pattern with support for common classes, groups, alternation, quantifiers, and multiple samples.
Flip Text Vertically
Flip text vertically by transposing characters, words, or sentences from each input row with custom output separators.
Fix Paragraph Distance
Normalize blank lines between paragraphs and lines, set custom distances, or glue paragraphs and lines together with custom symbols.
Erase Words from Text
Erase listed or random words from text by replacing their letters with repeated blank symbols while preserving each word width.
Convert Nice Columns to Text
Convert aligned plain-text columns back to text, ignore selected columns, and choose custom glue symbols for column gaps and line breaks.
Convert Text to Nice Columns
Convert delimited text into aligned columns with custom input and output separators, optional separator alignment, and left, right, or center padding.
Split Text
Split text into pieces by a separator, a regex, a fixed width, or a number of chunks, then format each chunk with custom wrappers.
Remove Random Symbols from Text
Randomly remove characters from text, preserve selected symbols or whitespace, and optionally keep word capitalization stable after deletion.
Remove Symbols from Around Words
Remove matching symbols from the left and right sides of words, clean repeated layers, and handle apostrophe or hyphen word parts.
Remove Random Letters from Words
Remove random letters from words, limit the removal to certain positions, and target or ignore specific letters when needed.
Randomize Line Breaks in Text
Randomize the number of line breaks between text fragments, trim loose line edges, and merge lines with a custom join symbol when needed.
Randomize Text Paragraphs
Randomize the order of text paragraphs, move them in groups, trim paragraph edges, and remove duplicates when needed.
Randomize Text Case
Randomize uppercase and lowercase letters in any text to create playful mixed-case output for memes, mockups, and experiments.
Reverse Words in Text
Reverse the letters inside every word, keep word order, and control how case, apostrophes, and hyphens are handled.
Test Text with a RegExp
Test text with a regular expression, validate the whole input or each line separately, and copy the status result.
Normalize Line Breaks in Text
Normalize uneven line-break runs in text and set a fixed newline count or join all lines into one clean string.
Find Text Length
Find the length of text, count spaces, tabs, and newlines, and print one value per line when needed.
Add Symbols Around Words
Add a left and right symbol around every word in text and copy the wrapped result in one click.
Find Unique Letters in Text
Find letters that appear exactly once in text and copy the unique-character list in one clean result.
Find Duplicate Letters in Text
Find repeated letters in text, count each duplicate character, and copy the result in one simple list.
Find Unique Words in Text
Find all words that appear only once in text and copy the unique-word list in one clean output.