Trying to replace Text with other text and Date

Trying to replace the text with the variable-containing the string and the current date.

What type of method should I go with??

For the dates use Regex
\d{1,2} (january|february|march|april|may|june|july|august|september|october|november|december) \d{4}
will find dates in the format 12 July 2019, 31 May 2019, etc. make sure the case-insensitive flag is set so the capitalization of the month doesn’t matter.

Replace with DateTime.Today.ToString("dd MMMM yyyy") for the current date.

For the other values do something similar. If the line always says “Recovery Debtor #######” then you can use Regex for that just change the search pattern based on your needs.


Hey, thanx for the code.
But since i am new on the UiPath Platform so dont have knowledge about regex[Still learning]can u please give me the details about the syntax and other things. That how should I go about it?

Check out the Replace activity. Here’s the documentation. You can just pass in a Regex pattern and replace any matches with your replacement.

As per screenshot I assume this is template for sending common emails…
if this is standard and fix format you can use string.format
below post might be able to help you out…

example of above post is like:

Text file = “Name:{0},Age{1},Country{2},CountryDuplicate{2}”
read text file into String variable strTemplate
strTemplate = String.Format(strTemplate,“Akshay”,“28”,“India”)

@AryanSingh you can go with replace text activity buddy,may be it works

i suggest to go you with the regex

  1. image

System.Text.RegularExpression.RegEx.Replace(“Variable of read pdf text”,"(?<=BALANCES for )(.*)(?=(:\s(\d)+/(\d)+/(\d)+))",“String which you want to replace with”)"


  1. image


System.Text.RegularExpression.RegEx.Replace(“Variable of read pdf text”,"(?<=(BALANCES for .*: ))((\d)+/(\d)+/(\d)+)",“String which you want to replace with”)"


Thanx, i will try and get back to you with it.