• Monday, May 28, 2012

Previous

Next

Stephen Ramsay’s Guide to Regular Expressions

July 27, 2009, 9:10 pm

Not a guide to negotiating the back-to-school barbecue, but a handy guide to manipulating text. Ramsay answers key questions like: Why should I care?  How can I improve my regex skills? Do I need anything to get started?

If you’ve ever typed “cp *.html ../” at the UNIX command prompt, or entered “garden?” into a web-based search engine, you’ve already used a simple regular expression. Regular expressions (“regex’s” for short) are sets of symbols and syntactic elements used to match patterns of text.

Even these simple examples testify to the power of regular expressions. In the first instance, you’ve copied all the files which end in “.html” (as opposed to copying them one by one); in the second, you’ve conducted a search not only for “garden,” but for “garden, gardening, gardens, and gardeners” all at once.

A .pdf version of Ramsay’s guide

Stephen Ramsay’s blog

This entry was posted in Software. Bookmark the permalink.

  • Print
  • Comment

Comments are closed.

  • The Chronicle of Higher Education
  • 1255 Twenty-Third St, N.W.
  • Washington, D.C. 20037