Replace
Reads text and replaces substrings matching with specified regular expression.
Last updated
Was this helpful?
Reads text and replaces substrings matching with specified regular expression.
Task version: 1.2.0
Required Frends version: 5.7+
Required .NET version: 8.0
Compatible Agents: Crossplatform
InputText : String
Text to be modified.
Default: -
Example: Example text.
RegularExpression : String
Regular expression pattern.
Default: -
Example: abc*
Replacement : String
Text to replace regex matches with.
Default: -
Example: foo
ThrowErrorOnFailure : Boolean
Whether to throw an exception on failure.
When false, errors are returned in the Result object instead.
Default: True
Example: true
ErrorMessageOnFailure : String
Custom error message used when ThrowErrorOnFailure is enabled or an error result is returned.
Leave empty to use the original exception message.
Default: -
Example: Regex replace failed
Success : Boolean
Indicates whether the task completed successfully.
Example: true
ReplacedText : String
Contains Regex-replaced input.
Example: Replaced text.
Error : Error
Error information, populated when Success is false.
Example: null
Changelog for Task Frends.Regex.Replace.
Added error handling support: a new Options parameter lets you control whether errors are thrown as exceptions or returned as part of the result object.
The task result now includes a Success flag and an Error property for more consistent error handling.
Updated target framework to .NET 8.
[Breaking] Parameter structure has been changed from the version that has been released to NuGet feeds.
Needed to increase the version number to fix the issue with .Net8 targeted processes not finding correct namespace.
Documentation updates.
Targeting changed to only include .NET 6.0 (removed .NET Standard 2.0)
Initial implementation
Last updated
Was this helpful?
Was this helpful?

