Filter a list
Table of Contents
- The quickest method of list filtering
- How to use
- Example usage
- How the tool processes input
- Examples & copyable regex patterns
- Tool chaining (workflows)
- Tips & edge cases
- FAQ
- Does regex mode support case-insensitive searches?
- What regular-expression features can I use?
- How are lines processed — can patterns match across lines?
- Can I filter many strings at once?
- What should I do if my pattern doesn't return expected results?
- Related tools
The quickest method of list filtering
This tool scans a multiline list line-by-line and keeps or removes lines that match a pattern. Use plain text for simple substring matches or enable the RegEx checkbox to apply regular expressions for powerful, flexible filtering.
How to use
- Paste your list into the input area.
- Enter a pattern (plain text or regex).
- If needed, check the RegEx box to treat the pattern as a regular expression.
- Choose the filter mode: Leave matches (keep matching lines) or Remove matches (discard matching lines).
- Click Filter and copy the result.
Example usage
Extract ASUS models from a product list:
- Pattern:
ASUS(leave RegEx unchecked for a simple substring match). - Set filter type to Leave matches.
- Click Filter.
Result: only lines that contain "ASUS" remain.
How the tool processes input
- Each input line is tested independently against the pattern.
- With RegEx enabled, the pattern is treated as a regular expression; without it, the tool performs a plain substring match.
- Use anchors (e.g.,
^,$) and boundaries (e.g.,\b) in regex mode to refine matches. - For best results on lists, pre-clean the input (remove empty lines, de-duplicate) before filtering.
Examples & copyable regex patterns
^ASUS— lines starting with "ASUS".\b\d{4}\b— lines containing a 4-digit year (e.g., 2022).^(?!.*refurb).*— exclude lines that contain "refurb" (negative lookahead).^[^@]+@example\.com$— match email addresses from example.com.ASUS(RegEx off) — simple substring match for "ASUS".
Tool chaining (workflows)
- Extract then filter: use Pattern Extractor to pull strings, then filter the extracted list to keep specific matches.
- Clean then filter: run Remove Empty Lines and Remove Duplicates first, then apply this filter for reliable results.
- Pre-process separators or punctuation with Remove Punctuation or Remove Non‑Alphanumeric Characters before filtering when patterns depend on character classes.
Tips & edge cases
- Test your regex on a small sample before running it on a very large list.
- If results are unexpected, try escaping special characters or toggling the RegEx checkbox to compare behavior.
- Use anchors (
^,$) to avoid partial matches when you need exact-line matches. - For bulk lists, consider de-duplicating (Remove Duplicates) after filtering.
- If you only need to remove lines containing a simple substring, consider Remove Lines Containing String for a quicker workflow.
FAQ
Does regex mode support case-insensitive searches?
The tool is case sensitive. If you need to make in non case sensitive - normalize case in a pre-step (convert the list to lowercase before filtering).
What regular-expression features can I use?
The RegEx checkbox lets you use standard regex constructs (anchors, character classes, quantifiers, groups, lookarounds). If a specific advanced feature is unsupported, test the pattern in the tool and adjust accordingly.
How are lines processed — can patterns match across lines?
Each line is evaluated independently. Patterns should be written to match a single line; multiline matches across line breaks are not applied unless the engine supports special flags — test your pattern on representative input.
Can I filter many strings at once?
Yes — paste a multiline list and run the filter. For best performance, remove empty lines (Remove Empty Lines) and duplicates (Remove Duplicates) beforehand when working with very large datasets.
What should I do if my pattern doesn't return expected results?
Verify whether RegEx is enabled, test a simpler pattern, escape special characters, and try anchors or word boundaries. Use small samples to iterate quickly before filtering the full list.
Related tools
- Pattern Extractor — find and extract strings that match a pattern.
- Remove Lines Containing String — remove lines with simple substring matches.
- Remove Empty Lines — clean blank lines before filtering.
- Remove Duplicates — de-duplicate results after filtering.
- Remove Non‑Alphanumeric Characters — normalize input when patterns depend on character sets.