@rahmu, this is how.
enum kWDEComponent{
kWDEAll,
kWDEDateTime,
kWDETimeBefore,
kWDETimeBeforeHour,
kWDETimeBeforeMinutes,
kWDETimeBeforeAMPM,
kWDEDate,
kWDEDateYearLast,
kWDEDateYearLastTwoDigits1,
kWDEDateYearLastTwoDigits2,
kWDEDateYearLastYear,
kWDEDateYearLastYear2Digits,
kWDEDateYearFirst,
kWDEDateYearFirstYear,
kWDEDateYearFirstYear2Digits,
kWDEDateYearFirstTwoDigits1,
kWDEDateYearFirstTwoDigits2,
kWDEMonthYearLast,
kWDEMonthYearLastMonth,
kWDEMonthYearLastDay,
kWDEMonthYearLastYear,
kWDEMonthYearLastYear2Digits,
kWDEMonthYearFirst,
kWDEMonthYearFirstYear,
kWDEMonthYearFirstYear2Digits,
kWDEMonthYearFirstMonth,
kWDEMonthYearFirstDay,
kWDETimeAfter,
kWDETimeAfterHour,
kWDETimeAfterMinutes,
kWDETimeAfterAMPM,
kWDETimeOnly,
kWDETimeOnlyHour,
kWDETimeOnlyMinutes,
kWDETimeOnlyAMPM
};
rolf wroteAwesome and horrible at the same time.
When you start learning about regex, and start using them, you tend to get excited, and write bigger and bigger regexes. But then you reach a point where it becomes too long to debug properly and you find yourself flying blind, and then you realise that you've reached a limit, and vow to yourself to use more loops and keep it simple next time.
I guess some persons never have this realisation.
Otherwise, thanks for the indirect tips you are giving us about software to work with regular expressions :)
I don't necessarily think of myself as an amateur when it comes to code. I am fallible though, a lot. In fact the above thing took me an inordinate amount of time to put together. I knew I will have to write a lot of code after finishing the regular expression, so I didn't want to go backtracking like hell. Seriously however, the regular expression is not hard at all to parse.
The thing I got going over there covers what's needed pretty well, and it's not actually hard to debug once you know how to format a regular expression. That's why you see all those indentations.
Alas, sharing is what it's all about, so you're welcome.
About the tools:
gskinner.com/RegExr/ - In the screenshot, you see the Desktop AIR version. Many times I would have three tabs of this site open to create my "compiling" procedure.
http://atastypixel.com/blog/reginald-regex-explorer/ - You'll have to compile this one from source as far as I could go. It was a simple build click and was done. I needed this since it uses the Objective-C version, so I was sure I wouldn't be having any surprises while going forward. I mostly used it to come up with the above enumeration.
TextMate is a great editor. I think it was able to switch to Regex mode just from the extension, but I am not sure.