Extract text between two characters
Pulls out everything between a start and end marker — every occurrence, not just the first.
Type the marker that starts the part you want and the one that ends it, then press the button. Every match in the text is returned on its own line — not just the first one, which is where most quick solutions stop.
Markers are literal, which is the point
Whatever you type is matched exactly. You do not need to escape anything: brackets, dots, asterisks, quotes and
slashes all work as themselves. This matters because the alternative — writing a regular expression — means remembering
that ( has to be written \(, and that mistake produces either an error or, worse, silently
wrong output.
Matching is non-greedy, so with markers ( and ) the text (a) and (b) gives you
a and b on separate lines, not the single result a) and (b that a greedy match
returns. Greedy matching is the number one reason people's extraction attempts come back with one enormous useless
result.
Common marker pairs
(and)— parenthetical notes, citations, abbreviations.[and]— references, tags, log levels."and"— quoted strings from code or CSV. Both fields are the same character, which is fine: each pair is taken in turn.<b>and</b>— text inside an HTML tag. For stripping all tags instead, use remove HTML tags.href="and"— every link target in a chunk of HTML.:and end-of-line — leave the end marker as a newline by typing\n… or simply use find and replace, which handles that shape better.
Remove between — the inverse
The second button deletes everything between the markers, including the markers themselves. This is how you strip bracketed asides from a transcript, remove HTML comments, delete timestamps in square brackets from a chat log, or clear the contents of tags while keeping the surrounding text.
What you get and what you should check
Results come back one per line in the order they appear. "Trim each result" is on by default, since a marker followed by a space usually means the space is not part of what you wanted. "Remove duplicates" is useful when extracting things like link targets, where the same URL appears many times.
If nothing matches, the tool says so rather than silently returning your original text — a small thing that saves you from copying an unchanged block and wondering later why the data looks wrong.
One real limitation: nesting. With markers ( and ) the text (a (b) c) gives
you a (b, because the first closing bracket ends the match. Genuinely nested structures need a parser, not
a pair of markers — for JSON or XML, use a tool built for that format.
Doing it without this tool
Excel: =MID(A1, FIND("(",A1)+1, FIND(")",A1)-FIND("(",A1)-1). That finds the first occurrence
only; getting all of them needs a nest of helper columns or VBA, which is why every Excel forum thread on this question
is forty replies long.
Notepad++: Find in regex mode with \((.*?)\) and Mark → "Copy marked text", which is a
sequence most people have to look up each time.
Command line: grep -oP '(?<=\().*?(?=\))' file.txt works with GNU grep and needs Perl
regex support, which macOS grep does not have by default.
Google Sheets: =REGEXEXTRACT(A1, "\((.*?)\)") — again, first match only.
Runs entirely in your browser. Your text is never uploaded — open DevTools, Network tab, and you will see zero requests while you use this tool.
How to use it
- Paste your text into the box.
- Type the start marker and the end marker exactly as they appear — no escaping needed.
- Press "Extract between" to pull out every match, one per line.
- Press "Remove between" instead if you want to delete those sections rather than keep them.
Related tools
Frequently asked questions
Every occurrence, each on its own line, in the order they appear. Spreadsheet formulas and most one-line regex answers only return the first match, which is the usual reason people end up here.
No. Markers are matched literally, so you can type ( or [ or " or * directly without escaping. That avoids the most common cause of a broken pattern.
The first closing marker ends the match, so (a (b) c) returns "a (b". Truly nested structures need a real parser for that format rather than a pair of markers.
Yes, press "Remove between". It deletes the matched sections including the markers themselves, which is how you strip bracketed asides or HTML comments.
You get a message saying nothing was found between your markers, rather than the original text returned unchanged, so you never copy stale output by mistake.