Extract quoted strings from text

Extract quoted strings finds every double-quoted and single-quoted span in pasted text and lists each on its own line. The match rules are "([^"]+)" and '([^']+)': a quote, one or more non-quote characters, then the matching quote. The surrounding quote characters are kept on each output line. Double-quoted matches come first, then single-quoted. The transform runs in your browser.

Input
Line 1:1 LF cloud_done Saved locally
Result Extract Quoted Strings
0 lines 0 chars

How quote matching works here

The matcher runs two passes. First it grabs every "..." span where the body is one or more characters that are not double quotes. Then it grabs every '...' span with the same rule for single quotes. The two lists are concatenated with double-quoted matches first, single-quoted second.

Smart curly quotes (“ ” ‘ ’) are not matched; only straight ASCII quotes " and ' are. To match curly quotes, run find and replace on the source first to swap and for ", and and for '. Apostrophes inside contractions can interfere with single-quote matching: "don't" contains an apostrophe that breaks '...' spans on either side.

Output is one match per line, with the surrounding quote characters intact. Strip the quotes downstream with regex replace (pattern ^["']|["']$, empty replacement, multiline) if you want just the quoted bodies. Order is double-quoted matches in source order, then single-quoted matches in source order, not interleaved.

How to use extract quoted strings from text

  1. 1Paste the article, transcript or message into the input panel.
  2. 2The output panel shows every quoted string, one per line.
  3. 3Click Copy to copy the list.
  4. 4Click Download to save it as a plain-text file.
  5. 5To match smart curly quotes, swap them for straight quotes with find and replace first.

Keyboard shortcuts

Drive TextResult without touching the mouse.

Shortcut Action
Ctrl FOpen the find & replace panel inside the input Plus
Ctrl ZUndo the last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor Plus
EscClose find & replace, or exit fullscreen
Ctrl KOpen the command palette to jump to any tool Plus
Ctrl SSave current workflow draft Plus
Ctrl PRun a saved workflow Plus

What counts as a quoted string here

Straight ASCII quotes only

Double " (U+0022) and single ' (U+0027). Smart curly quotes are not matched. Replace them with straight quotes first if your text uses typographic punctuation.

Body must contain at least one character

The pattern uses +, so empty quoted spans ("" or '') are not matched. Single-character quoted strings ("a") do match.

No nesting and no escapes

A " inside a double-quoted span ends the match early. There is no support for backslash-escapes (\") the way a programming language would handle them. For source code, treat the output as approximate.

Surrounding quotes kept

Each output line includes the opening and closing quote characters. "hello" is output as "hello". Strip them with regex replace if you only want the bodies.

Double-quoted matches first, then single-quoted

The output lists every double-quoted match in source order, then every single-quoted match in source order. The two are not interleaved. Apostrophes inside contractions can break single-quoted matches; consider running extract regex matches with a stricter pattern if your data has many contractions.

Worked example

Double-quoted matches come first ("hello", "meet at noon"), then single-quoted matches ('hi', 'utf-8'). Smart curly quotes would not match here; convert them to straight quotes first.

Input
He said "hello" and she replied 'hi'.
The note read "meet at noon".
Use 'utf-8' when saving.
Output
"hello"
"meet at noon"
'hi'
'utf-8'

Settings reference

Behaviour Effect on output
Quote characters Straight ASCII " and '. Smart curly quotes not matched.
Body length At least one character. Empty "" and '' not matched.
Nesting and escapes No support. An inner " ends the match early; \" is not unescaped.
Output ordering Double-quoted matches first, then single-quoted, each in source order.
Surrounding quotes Kept on every output line. Strip with regex replace if you want just the bodies.
Apostrophes in prose Can break single-quoted matches. Mask them or use extract regex matches with a stricter pattern.

FAQ

Why does my "don't worry" sentence give odd single-quoted results?
The apostrophe inside don't looks like a single quote to the matcher. When it scans for '...' spans it can pair the apostrophe with another single quote much later in the text. To avoid this, replace the apostrophe with a curly (or any safe placeholder) using find and replace before extracting, then restore it after.
Will smart curly quotes match?
No. The pattern uses straight ASCII " and ' only. Run find and replace first to swap “ ” for " and ‘ ’ for ', then extract.
Are the quote characters included in each output line?
Yes. "hello" is output as "hello". To strip the surrounding quotes, run regex replace on the output with pattern ^["']|["']$, empty replacement, multiline flag.
Why are double-quoted matches grouped before single-quoted ones?
The tool runs two separate passes (double quotes first, then single quotes) and concatenates the lists. This keeps the regexes simple and avoids ambiguity around apostrophes. If you need source-order interleaving, use extract regex matches with a combined pattern like "[^"]+"|'[^']+'.
Is anything sent to a server?
No. The match runs entirely in your browser.