All Products
Search
Document Center

DataWorks:String replacement

Last Updated:Apr 23, 2026

In DataWorks, you can use the string replacement component in single-table, real-time data integration tasks to replace strings in specified fields.

Step 1: Configure a data integration task

  1. Create a data source. For more information, see Data source management.

  2. Create a Data Integration task. For more information, see Configure a single-table real-time synchronization task.

    Note

    For single-table real-time Data Integration tasks, you can add a data processing component between the source and destination components. For more information, see Supported data sources and synchronization solutions.

Step 2: Add a string replacement component

  1. In the single-table real-time synchronization task, enable the Data Processing switch, click +Add Node, and select the Replace String component.

  2. Configure rules.

    Click Add Rule to configure one or more rules by using the following parameters.

    • Field name: Select a text field from the upstream node.

    • Original string: The string to be replaced. When regular matching is disabled, Java escape characters such as \t (tab character), \n (line feed), and \u0001 (Unicode character) are supported.

    • New string: The replacement string. When regular matching is disabled, Java escape characters such as \t (tab character), \n (line feed), and \u0001 (Unicode character) are supported.

    Note
    • Regular matching: Enables matching by using a regular expression. If you enable this option, the original string supports regular expression rules as defined in Class Pattern. The new string can then reference capture groups from the expression by using $ followed by a number. For example, if a field contains no.9526, you can set the Original string to no.([0-9]+) and the New string to $1. The field's content is then changed to 9526.

    • Case Sensitive: Enable to make the search for the original string case-sensitive.

    image

Next step

After configuring the Data Source and string replacement components, click Preview Data Output to view the node's data output and verify that it meets your requirements.