Find and replace
Find and replace text with plain words or regular expressions with capture groups, a live match count and highlighted matches.
Runs in your browserNothing uploadedWorks offline
Loading Find and replaceRuns on this device. Nothing is uploaded.
Questions
How do I use capture groups?
Turn on "Regular expression", wrap parts of the pattern in parentheses and use $1, $2 and so on in the replacement. Named groups work too: (?<year>\d{4}) and $<year>. $& inserts the whole match.
Can I insert a line break?
In regular expression mode, \n in the replacement becomes a new line and \t a tab. In plain mode the replacement is used exactly as typed.
Which regular expression syntax is this?
JavaScript's, with the Unicode flag on, so \p{L} matches any letter. ^ and $ match at the start and end of each line.
Related tools
All text and documents toolsDeveloperRegex testerTest a JavaScript regular expression live: matches highlighted, capture groups in a table, flags, replace, and a plain-English explanation.Text and documentstxt md plaincamelCase converterTurn phrases, column names or snake_case into camelCase identifiers, one per line, as you type.Text and documentstxt md plainCase converterChange text to UPPER, lower, Title Case, Sentence case, camelCase, PascalCase, snake_case, kebab-case or CONSTANT_CASE as you type.Text and documentstxt md markdownCharacter counterCount characters as you type, spaces included, with the count without spaces, words and sentences next to it.Text and documentstxt md plainClean AI textFix text pasted from ChatGPT, Claude and terminals: show and remove hidden characters, rejoin broken lines, fix quotes, spaces and Markdown.Text and documentstxt md csvCompare text (diff)Compare two texts or files side by side or inline, by line, word or character, with changes highlighted and a downloadable patch.