Regular Expression Documentaion

You are not authorized to view comments.

Regular Expressions are super powerful, and are included in most programming languages.
Regardless of what programming language you use, regular expressions will make certain text processing tasks a breeze.
If you have ever looped through every character in a string of text searching for specific characters just stop and learn regular expressions.
You will be so glad you did.

Perl

http://perldoc.perl.org/perlrequick.html
http://perldoc.perl.org/perlre.html
http://perldoc.perl.org/perlretut.html

PHP

http://php.net/manual/en/book.pcre.php
http://php.net/manual/en/reference.pcre.pattern.syntax.php

JAVA

http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html

Javascript

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp

Practice in your browser

You can practice writing javascript regular expressions in your browsers' javascript console (Ctrl+Shift+J) in Chrome.
Phone number example:
Navigate to: http://www.senate.gov/general/contact_information/senators_cfm.cfm which is a list of US Senators.
Open your javascript console and type:

var regx1 = /((\d)?\(?\d{3}\)?[\s\-\.]\d{3}[\s\-\.]\d{4})/g;

Press enter and then type

document.documentElement.innerHTML =  document.documentElement.innerHTML.replace(regx1,"<h1>$1</h1>");

Press enter and all of the phone numbers will be wrapped in H1 tags.

Note: This could be accomplished much more easily in jQuery, however regular expressions are built in to practically every programming language and offer a lot of power for pattern matching and substitution.
This page for instance has the same class of contenttext for all of the table cell data. Even if the phone numbers had a separate class, we have no guarantee that there isn't other data in the cell. By using a regular expression we can match only the pattern we are interested in using very a very rigid expression.