How to Extract date from given string

Hi all,

i want to extract the date from the given sentence.Sentence is not constant.
Input : The Today Date is 18/03/2020 .completed
output: 18/03/2020
input:The Business is on 17/03/2020 sharply.
output: 17/03/2020
can anyone please help me in this case.

1 Like

@Shivaraju Will the date be always in the Same Format?
If it is in the same format, you can use this Expression :
System.Text.RegularExpressions.Regex.Matches(inputString,“\d{2}/\d{2}/\d{4}”)(0).toString

4 Likes

@cody.barber ,

They are using the index as 0, so even if we get more matches the first one alone.

1 Like

oh, thats great, i can use a for loop to get all the dates separate thanks

1 Like

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