• ARTICLE
  • STRING
  • CONVERTER
  • ENCRYPT
  • NETWORK
  • MORE
    CHART
    MATH
    COORDINATE
    IMAGE
    FILE
  • ARTICLE
    STRING
    CONVERTER
    ENCRYPT
    NETWORK
    MORE
    CHART
    MATH
    COORDINATE
    IMAGE
    FILE
logo Online Tools
2 Comments Favorite Copy Link Share

Find and Replace Text Online


Find and Replace Text Online-summary

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.

Find and Replace Text Online-instructions
  1. Mode:
    1. Text Replace : Use text to find the content to be replaced.
    2. Regex Replace : Use regular expressions to find the content to be replaced.
  2. Search Text : Find the text to replace.
  3. Search Regex : Use JavaScript regular expressions to find the text to be replaced. The supported regular expression syntax is Javascript Regular Expression.
  4. Regex Flag : The control flags of regular expression, which can be empty. This tool supports the following control flags:
    1. s : dotAll Whether . matches newlines or not.
    2. g : global Whether to test the regular expression against all possible matches in a string, or only against the first.
    3. d : hasIndices Whether the regular expression result exposes the start and end indices of captured substrings.
    4. i : ignoreCase Whether to ignore case while attempting a match in a string.
    5. m : multiline Whether or not to search in strings across multiple lines.
    6. y : sticky Whether or not the search is sticky.
    7. u : unicode Whether or not Unicode features are enabled.
  5. 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:
    1. $$ : Inserts a "$".
    2. $& : Inserts the matched substring.
    3. $` : Inserts the portion of the string that precedes the matched substring.
    4. $' : Inserts the portion of the string that follows the matched substring.
    5. $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.
  6. 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.
  7. Download : Download the processing results locally.
  8. Use Example:
    1. Replace all dogs with cat : The parameters used are Mode - Text Replace, Search Text - dog, Replace Text - cat.
    2. 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.
      Input
      REPOSITORY                                                       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

      Output
      REPOSITORY                                                       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