Free tool
Regex extract:
pull out pattern matches
With regex extract you type a pattern (regular expression) and keep only the parts of each line that match. Choose a group number to keep only the part in brackets.
The example is loaded. Paste your own list to replace it.
→ 3 lines
Pattern
Group to keep (0 = the whole match)
Match capital letters exactly
From each line take
Your text
Result
What it does
Keep only the parts of each line that match a pattern (regular expression).
Settings you can change
- Pattern
- Group to keep (0 = the whole match)
- Match capital letters exactly
- From each line take: Every match, The first match
When to use it
Pull every product code shaped like two letters and four digits out of messy descriptions.
Example: regex extract
Settings used: Pattern: [A-Z]{2}\d{4}; Match capital letters exactly: on.
Input
Result
Tips
- Use a group to keep only part of a match: price: (\d+) with group 1 keeps the number.
Often used with
Replace text in every line. Type \n in "Replace with" to start a new line.
Filter lines by a word or pattern.
Pull numbers out of text, like prices or counts.
Your text stays on this computer
Got your list from a web page?
HeyScraper turns the page you’re on into a spreadsheet, so you can skip the copying and pasting. Free: 500 pages a month.
Get HeyScraper