Regex pattern to extract date format ddMMMyyyy

I have this text “SAVE.INCOMING_418745_16MAR2021(1).ASCII.EPIN.TXT” i want a regex to extract 16MAR2021. Please how do I go about it again.
I wrote this (\d{2}\w{3}\d{4}) but i don’t think its efficient enough


Maybe this would do:


Thank you . I am trying to achieve something that wouldn’t end up matching a string like “16COT2021” because COT is not a valid month


Check as below for your reference

Hope this may help you


1 Like

What @Srini84 said but remove ^ and $ if you want to match text in the middle. Also you need the option IgnoreCase if the months are not always in upper case.



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