In Snowflake, with REGEXP_SUBSTR, how do you extract the date from a string with M/D/YYYY, M/DD/YYYY, MM/DD/YYYY, MM/DD/YYYY formats?
Below is an example of a string. I would like to extract “2/23/2024 -> 3/18/2024”. How would I do that considering the date can also be in the format of M/D/YYYY, M/DD/YYYY, MM/DD/YYYY or MM/DD/YYYY?
JOE_SMITH 10:54:11
ORDERDATE: 2/23/2024 -> 3/18/2024
Here is what I tried:
([A-Za-z0-9]+(/[A-Za-z0-9]+)+) -> ([A-Za-z0-9]+(/[A-Za-z0-9]+)+)
I receive a NULL.
HoosierDuckling is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.