How to store date in a variable by mail subject?

Hi team,
below mail subject in which i wanted to extract the date and store it in variable
Exchange rate w e f 15.08.2024

Hi @Naveen_Kanike

(\d+\.\d+\.\d+)

Regards,

Hi @Naveen_Kanike

Ypu can use below assign syntax:

Str_date = System.Text.RegularExpressions.Regex.Match(currentMailMessage.Subject, "\d+\.\d+\.\d+").Value.Trim()

Regards

subject format will change but when i find date i need to store is it possible

@Naveen_Kanike

It will work if the date format fixed

@Naveen_Kanike

System.Text.RegularExpressions.Regex.Match(Input, "(\d+\.\d+\.\d+)").Value

data format will be allways dots i can control it.

@Naveen_Kanike

It will work…Try that

i am getting empty message box

Hie @Naveen_Kanike here the pattern you can use to get the date

System.Text.RegularExpressions.Regex.Match( inputText,“\b\d{1,2}[./-]\d{1,2}[./-]\d{2,4}\b”).Value

cheers

@Naveen_Kanike

Please check if the date is there or not in mail subject.
If date is not there in mail subject then it prints empty

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