Extract date of format 'February 10, 2024' usingn regex

Hi All, Can someone help me to retrieve the date from a string as February 10, 2024 using Regex

Below is the string available

Expected output : February 10, 2024
Input String : February 10, 2024 Hello How are you doing .

@Harsha_Vemula

use assign

strvar = System.Text.RegularExpressions.Regex.Match("February 10, 2024 Hello How are you doing",".*, \d{4}").Value

cheers

1 Like

Hi @Harsha_Vemula

Try this way,

String variable → System.Text.RegularExpressions.Regex.Match("Str variable","\D+\d+\,\s+\d+").ToString.Trim

Regards,
Gowtham K

Hi @Harsha_Vemula,
Try this expression
\D+\s\d+,\s[0-9]{4}


OR
\D+\d+[,]?\s\d{4}