All Products
Search
Document Center

DataWorks:String replacement

Last Updated:Feb 27, 2026

In DataWorks, you can use the Replace String component to replace strings in specified fields within a real-time single-table synchronization task.

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 synchronization tasks in Data Integration, you can add data processing nodes between the Source and Destination nodes. For more information, see Supported data sources and synchronization solutions.

Step 2: Add the Replace String component

  1. In a real-time single-table synchronization task, turn on the Data Processing switch, click +Add Node, and add a String Replacement component.

  2. Configure the transformation rules.

    Click Add Rule. You can add multiple rules. Configure the following information:

    • Field name: Select a text field from the input of the previous component.

    • Content to be replaced: The source string to find. When regular matching is disabled, you can use Java escape characters, such as \t (tab character), \n (line feed), and \u0001 (Unicode character).

    • Replacement content: The string that replaces the matched content. When regular matching is disabled, you can use Java escape characters, such as \t (tab character), \n (line feed), and \u0001 (Unicode character).

    Note
    • Regular matching: Specifies whether to use regular expressions. If you enable this option, the Original string field supports expressions based on the Java Pattern class. You can use $ followed by a number (for example, $1) in the New string field to reference a captured group. For example, if a field contains no.9526, set Original string to no.([0-9]+) and New string to $1. The field content is then replaced with 9526.

    • Case Sensitive: Specifies whether matching for the Original string is case-sensitive.

    image

Next steps

After configuring the Data Source and the Replace String component, click Preview Data Output to preview the output and verify that it meets your requirements.