What Are Regular Expressions?

You've asked for a simple explanation of "regular expressions." I'll do my best to give it to you, along with some resource web links with more in-depth responses.

Regular expressions are sentences used to find specific types of text-based data, or "strings" of data. Symbols in the data strings can include letters and numbers. They are "regular" symbols. So, if you want to find a saved document on your computer that you think has the word Christmas in the title, the string you want looks for the letters "c-h-r-i-s-t-m-a-s" in that order, in a document title.

Now, you can set up a regular expression search for this data. A slightly more complex regular expression would allow you to locate only those items in a list, or a set of data, which include certain numbers. If you want sales entries that are between $400 and $500, or if you want to verify phone numbers or zip codes-- you would use regular expressions to set up the search parameters. You do this because regular expressions search parameters include searches for letter and number symbols, and can be written to differentiate between different types of content. One of the web links I've included below discusses the use of regular expressions to determine password strength.

Regular expressions are used in marketing, in library cataloging systems, in search engines, and online forms. They help the user determine whether or not an entered string of data (a phone number, for example) fits the required format (ten digits, for a phone number). They also help us find all entries that fit a certain profile (all phone numbers that begin with 503, for example), or that do NOT fit into a certain pre-determined set (all those phone numbers for Oregon that are NOT located in Portland, and do NOT have a 503 area code, for example). As the searcher's skill at writing the sentences that express a search's parameters improves, the search itself can become much more complex.

Here are some resource websites relating to regular expressions:

  • http://www.jroller.com/rolsen/entry/regular_expressions_in_ten_steps
  • http://jroller.com/rolsen/entry/regular_expressions_in_ten_steps1
  • http://www.oracle.com/technology/oramag/webcolumns/2003/techarticles/rischert_regexp_pt1.html
  • http://www.marketingtechblog.com/2007/08/27/javascript-password-strength/
  • 1 comment

    Add a comment

    0 answers +0 votes
    Post comment Cancel
    lolz
    0
    This comment has 0 votes  by
    Posted on Nov 10, 2008