Author: Anne Sonnenschein Created: 11/13/2015
This tutorial is designed to give a brief introduction to regular expressions.
Regular expressions (or regex) are a language for search and replace. They allow search for wild-cards: characters that can match more than one string. This can be especially useful for text editing, or converting large files from one format to another. Regular expressions are enabled in some text editors, and many programming languages (notably Python and Perl). In Unix they are implemented in tools such as grep and sed. The syntax is generally common across platforms.
In this tutorial, you will learn syntax for simple regular expressions, and how to implement them in text editors, python and perl.
For this part of the activity you will need a text editor with regular expressions enabled. For the exercise at the end, you will need either Python or Perl.
TextWrangler (Mac) http://www.barebones.com/products/textwrangler/download.html
Notepad++ (Windows) https://notepad-plus-plus.org/download/v6.8.6.html
# python code
import this
Haddock and Dunn, 2011. Practical Computing for Biologists, chapter 2