Related Tools
The online text search and replacement tool uses text or regular expression to find the target text, and then replace it with new content. The replacement content supports text and the back reference of regular expressions.
-
Mode:
- Text Replace : Use text to find the content to be replaced.
- Regex Replace : Use regular expressions to find the content to be replaced.
- Search Text : Find the text to replace.
- Search Regex : Use JavaScript regular expressions to find the text to be replaced. The supported regular expression syntax is Javascript Regular Expression.
-
Regex Flag : The control flags of regular expression, which can be empty. This tool supports
the following control flags:
- s : dotAll Whether . matches newlines or not.
- g : global Whether to test the regular expression against all possible matches in a string, or only against the first.
- d : hasIndices Whether the regular expression result exposes the start and end indices of captured substrings.
- i : ignoreCase Whether to ignore case while attempting a match in a string.
- m : multiline Whether or not to search in strings across multiple lines.
- y : sticky Whether or not the search is sticky.
- u : unicode Whether or not Unicode features are enabled.
-
Replace Text : The found text will be replaced with this content. If empty, replace the
matching text with empty. The replacement content can include the following special
patterns:
- $$ : Inserts a "$".
- $& : Inserts the matched substring.
- $` : Inserts the portion of the string that precedes the matched substring.
- $' : Inserts the portion of the string that follows the matched substring.
- $n : Where n is a positive integer less than 100, inserts the nth parenthesized submatch string, available only in regular mode. Note that this is 1-indexed.
- Open File : Open the local text file, and the supported file encoding is UTF-8. If your file is not encoded like this, you can open it in another editor and copy it into the input.
- Download : Download the processing results locally.
-
Use Example:
- Replace all dogs with cat : The parameters used are Mode - Text Replace, Search Text - dog, Replace Text - cat.
-
Replace the MySQL image name to mysql@version form:The parameters used are Mode -
Regex Replace, Search Regex - (mysql)(\s+)(\d+\.\d+\.\d+), Regex Flag
- i(ignoreCase), Replace Text - $1@$3$2$3.
InputREPOSITORY TAG IMAGE ID CREATED SIZE nginx 1.19.7 35c43ace9216 16 months ago 133MB mysql 5.7.31 d05c76dbbfcf 24 months ago 448MB redis latest 191c4af7dcdd 2 years ago 89.3MB mYsql 5.7.12 2fd136002c22 6 years ago 378MB
OutputREPOSITORY TAG IMAGE ID CREATED SIZE nginx 1.19.7 35c43ace9216 16 months ago 133MB mysql@5.7.31 5.7.31 d05c76dbbfcf 24 months ago 448MB redis latest 191c4af7dcdd 2 years ago 89.3MB mYsql@5.7.12 5.7.12 2fd136002c22 6 years ago 378MB