Thursday, July 03, 2008

Regex power

I've been hooked to regex for a couple of days now and getting to know the real power of it. I wish that I had tried this years ago.

And the coolest one is this one which I just figured out. Change the date format from DD/MM/YYYY to MM/DD/YYYY and vice versa (assuming date is the first field in the line).

Search: ^{[0-9]*}/{[0-9]*}
Replace: \2/\1

I did this in MS VC.Net 2003 editor, and as far, its supports regex well.