Get last date from string using Regex/Match

Hii

I want to get last date from string using regular expression(Match)

String-
, and is February 12, 2022 proudly hosted by Media Temple.

Edit the Expression & Text to see matches. February 12, 2022 Roll over matches or the expression for details. PCRE & JavaScript February 12, 2022 flavors of RegEx are supported. Validate your expression with Tests mode.

@Vishal_Prajapati

Try :

system.Text.RegularExpressions.Regex.Match(input-String,“(?<=PCRE & JavaScript )[\w]+.[\d]{0,2}.{0,2}[\d]{0,4}”).ToString

Hi,

Can you try the following expression?

System.Text.RegularExpressions.Regex.Match(yourString,"(January|February|March|April|May|June|July|August|Septembet|October|November|December)\s+\d{1,2},\s+\d{4}(?=[\s\S]*?$)",System.Text.RegularExpressions.RegexOptions.IgnoreCase).Value

Regards,

@Vishal_Prajapati

Find the screenshot:
image

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