Children's Mercy Hospital
Find a Doctor | Press Room | Careers | Directions & Locations

About Us | Contact Us | Giving to Children's Mercy
For Patients and Families   Your Child's Health   Clinical Services   |   For Health Care Professionals   Medical Education   Medical Research

More on regular expressions (July 21, 2005) Category: Data management

As I work more and more with microarrays, the more I realize that having a knowledge of regular expressions will help. For example, I had a comma separated file (.CSV) and it had an extra comma at the end of every line. I wanted to remove those commas, but not any of the others.

It turns out that my text editor (textpad) will allow search and replace on regular expressions. So I searched for

  • ,$

and replaced it with a null string. The dollar sign says to match a string only if it is at the end of a line. If I had wanted to replace any commas that begin a line of text, I could have searched for

  • ^,

This webpage was written by Steve Simon and was last modified on 07/08/2008.