Last 10:

Archives:

WP Links:

home button news button clients button cv button

July 4, 2007

RegexBuddy - A Coder’s Best Friend

Filed under: Programs, Coding — admin @ 3:41 pm

I’m pretty handy with a chunk of code. Within a couple of seconds I can parse just about any regular expression with a reasonable amount of success. What I can’t seem to do is write the darn things when switching between JavaScript, PHP, VB.NET and VBscript. That’s where RegexBuddy comes in.

RegexBuddy is a little, but powerful, program written by a company called JGSoft (Just Great Software - catchy, no?). I was already a supporter of EditPad Pro, which is a replacement for Notepad that allows regular expression find and replaces, tabbing, line numbering and tons of other features, but I’m downright evangelical about RegexBuddy. You can build your expressions by hand or use the helpful “Insert Token” button, you can have your expression explained back to you in plain English, you can test your expression against a string you insert, but best of all, you can have the program build the entire script you need - in the coding language of your heart’s desire!

Being that I’ve just jumped into SQL Server 2005 with both feet, my knowledge of VB.NET is not nearly as complete as my knowledge of PHP and VBscript. Even once I had my expression, and was confident that it should return the proper results, I didn’t know that I had to import a library to use it. RegexBuddy knew.

Long story short, there’s a text file I’ve been procrastinating about parsing and cleaning up for almost 3 years. Using RegexBuddy I built, tested and implemented a housekeeping function in just over an hour. A 500KB files was reduced to under 30KB and made importing into SQL a breeze. Yay RegexBuddy! Now I just need to find my credit card to pay for the program…

If you’re curious about the expression that made my life so easy, here it is: “^.* (\d?\d/\d?\d/\d{4}) to \1.* (\d{4}[BMR]|\d{7}).* \d?\d:\d\d:\d\d.* \d?\d:\d\d:\d\d.*(\d?\d:\d\d:\d\d).* \d?\d:\d\d:\d\d.* (\d?\d:\d\d:\d\d).*$” which I then used in a replace with “$1,$2,$3,$4″.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress

Quinte Web Design Kennedy Data Solutions Jacob Kennedy MS Access Microsoft Access ASP Web Design Website Web Site Database Parry Sound Trenton Ontario Canada Quinte West Prince Edward County Belleville Deseronto