activities
latest
false
UiPath logo, featuring letters U and I in white

Workflow Activities

Last updated Dec 20, 2024

Replace Matching Patterns

UiPath.Core.Activities.Replace

Description

Within a specified input string, replaces strings that match a regular expression pattern with a specified replacement string. This activity has a RegEx Builder wizard that can be used to configure it, on which you can read more here.

Project compatibility

Windows - Legacy | Windows | Cross-platform

Cross-platform configuration

  • Text to replace - The string to be replaced.
  • Pattern - The regular expression pattern to match.
  • Replacement with text - The replacement string.
Additional properties
  • Pattern options - A bitwise combination of the enumeration values that specify options for matching.
  • Result - A boolean variable that is set to true if the regular expression finds a match, and is set to false otherwise.

Windows - Legacy, Windows configuration

Designer panel
  • Configure Regular Expression ... - Opens the RegEx Builder wizard where you can specify the regular expression pattern to be matched.
Properties panel
Common
  • DisplayName - The display name of the activity.
Input
  • Pattern - The regular expression pattern to match.
  • Pattern options - A list of specific options for matching.
  • Replace text - The replacement string.
  • Text to replace - The string to be replaced.
  • Timeout (ms) - The maximum duration, in milliseconds, that a pattern-matching operation can run before it is terminated. This property is essential for preventing the app from slowing down or freezing when processing complex or inefficient patterns. If the pattern match does not complete in the set time, an exception is thrown, ensuring the application remains responsive and safe from possible attacks that try to overload it.

    Important:

    We highly recommend setting a timeout value, to improve application stability and security.

Misc
  • Private - If selected, the values of variables and arguments are no longer logged at Verbose level.
  • Result - A new string that is identical to the input string, except that a replacement string takes the place of each matched string.

Example of using the Replace activity

Here you can see how the Replace activity is used in an example that incorporates multiple activities.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.