Test, validate and match regular expressions
This regex matches a date in the format YYYY-MM-DD or YYYY/M/D, strictly validating leap years and days in each month. It allows hyphens, forward slashes, or spaces as separators between date components. Additionally, it optionally matches a time portion in H:MM or HH:MM:SS format. This pattern is ideal for validating timestamps in user input or log files.