Regex_Date

2023-04-17 18:32:02.747 6:32PM
17/04/2023 6:32PM
I want only Date like 17/04/2023 , 2023-04-17

Hi @Kuldeep_Pandey ,

From the First Glance it seems the date has been separated with a Space, So maybe a Split is what was required ?

Split(YourString)(0)

Not working

Hi,

How about the following pattern?

\b\d{2,4}[-/]\d{2,4}[-/]\d{2,4}\b

image

Regards,

Please explain me tjis

Hi,

\b means word boundary. this prevents to match 5 or more digits number in this case. For example, 12345-12-23 doesn’t match because of \b

\d{2,4} means 2 ,3 or 4 digits number.
[-/] measn - or /

So, \b\d{2,4}[-/]\d{2,4}[-/]\d{2,4}\b matches both 17/04/2023 and 2023-04-17

Regards,

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