Tips for using regular expressions

by John on June 27, 2008

Jeff Atwood just posted a good article on regular expressions. Not the syntax of regular expressions but rather the strategy of when and how to use them.

{ 1 comment… read it below or add one }

1

Codewiz51 06.28.08 at 10:30

I have to give a vote for the O’Reilly books in you want to learn regular expressions. Almost any book on the perl language will have significant sections on RegEx expressions. http://oreilly.com/catalog/9780596528126/index.html

For me, the first thing that rings a bell for RegEx is free form data entry fields that are stored in a database. Extracting useful data from a varchar2(2000) field is fairly difficult. Misspellings, abbreviations, different writing styles, “you name it” data entry makes for difficult extraction. RegEx is extremely useful for organizing free form data into something meaningful. The biggest problem is making sure you are not adding meaning where none exists.

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>