Start a new topic

Need Regex to format date from YYYY-MM-DD to MM/DD/YYYY

I need a regular expression to convert a date that is coming in YYYY-MM-DD.  I found the article in knowledgebase on regular expressions and saw item 17 (see below), however my separator is a hyphen rather than a slash.  Please help.

17. Changes date format from YYYY/MM/DD to MM/DD/YYYY:

 

                Replacement Value: $2/$3/$1

                Value to Match On: (^\d{4})/((?<=/)\d{2}(?=/))/(\d{2}$)



Hi Cathy,


Value to match on: (\d{4})-(\d{1,2})-(\d{1,2})  Replacement value: $2/$3/$1


Thanks,


John

That worked! Thank you so much!

Login or Signup to post a comment