Text extraction based on Regex

Hi, I should extract the confirmed delivery date and store in list only if there is no key word(content of) in the text file below.
TEST.txt (1.6 KB)

Thank you,.

Hi @Midhila_Gurram

Can you repost the file ?

Cant able to download it

Regards
Sudharsan

TEST.txt (1.6 KB)

Hey @Midhila_Gurram

(?is)Confirmed Delivery date.*?(\d{1,2}.\d{1,2}.\d{4})

This regex to get the dates from the text file. And use Matches activity to get multiple dates from the text file.

thank you, but This will get all the delivery dates, I want the delivery dates only when the key word(content of) is not there above the delivery date

Hey @Midhila_Gurram,

Try this regex

(?:(content of\D*(\d+)\n*Confirmed Delivery date)|Confirmed Delivery date.*?(\d{1,2}.\d{1,2}.\d{4}))

This regex will return the Content of whenever it will find it and if not then the confirmed delivery date.

Happy Learning
Regards,
Achal Sharma

try this

^Order.*\n?Confirmed Delivery date\s+\d{2}\.\d{2}\.\d{4}$

in match activity later use for each of the matchs
assign activity - provide system.text.regularexpression.regex.match(currentitem,“\d{2}.\d{2}.\d{4}”).Value

Hope this helps

hey @Midhila_Gurram

the matches activity thing is working on my side. can you show me the flow?

Thank you,
@Achal_Sharma @LAKSHMI_NARAYANA_PEMMASAN

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.