In my application user can specify the pattern for dates by entering it in the textbox. This pattern is used for logging messages. For example, if user specify 'dd-MM' then in the log file he could see following:
[12-06] Some message...
[02-09] Some message 2...
How to validate this pattern? How to protect entering wrong patterns?