Text Find and Replace

Replaces all occurrences of the first string with the second.

Input: TextResult: Text

Text input

Tool options

Examples

Normalize repeated spaces in a copied HTTP request

Input

GET    /health  HTTP/1.1
Host:   example.org

Expected answer

GET /health HTTP/1.1
Host: example.org
Find
{"option":"Regex","string":"[ \\t]+"}
Replace
Global match
On
Case insensitive
Off
Multiline matching
On
Dot matches all
Off
Redact a demo bearer token while retaining the header name

Input

Authorization: Bearer DEMO_TOKEN_NOT_VALID
Accept: application/json

Expected answer

Authorization: Bearer [REDACTED]
Accept: application/json
Find
{"option":"Regex","string":"(Authorization: Bearer )\\S+"}
Replace
$1[REDACTED]
Global match
On
Case insensitive
Off
Multiline matching
On
Dot matches all
Off
Move endpoint URLs to a new hostname literally

Simple string treats the dots as dots, rather than regular-expression wildcards.

Input

https://old.example.org/v1/status
https://old.example.org/v1/jobs

Expected answer

https://api.example.org/v1/status
https://api.example.org/v1/jobs
Find
{"option":"Simple string","string":"old.example.org"}
Replace
api.example.org
Global match
On
Case insensitive
Off
Multiline matching
On
Dot matches all
Off
Complete only the first item in a task list

Input

TODO: write test
TODO: deploy

Expected answer

DONE: write test
TODO: deploy
Find
{"option":"Simple string","string":"TODO"}
Replace
DONE
Global match
Off
Case insensitive
Off
Multiline matching
On
Dot matches all
Off
Disable debug flags with case-insensitive line matching

Input

DEBUG=true
port=8080
debug=true

Expected answer

debug=false
port=8080
debug=false
Find
{"option":"Regex","string":"^debug=(?:true|false)$"}
Replace
debug=false
Global match
On
Case insensitive
On
Multiline matching
On
Dot matches all
Off

Includes support for regular expressions (regex), simple strings and extended strings (which support \n, \r, \t, \b, \f and escaped hex bytes using \x notation, e.g. \x00 for a null byte).

Format reference: Find / Replace background and specification

Parameters

ParameterDefault valueInput and choices
Find{"option":"Regex","string":""}Key/text encoding: Regex, Extended (\n, \t, \x...), Simple string
Replace""Escape sequences such as \n, \r and \t are supported
Global matchtrueOn or off
Case insensitivefalseOn or off
Multiline matchingtrueOn or off
Dot matches allfalseOn or off

Related tools

Browse utils tools