http://weblogtoolscollection.com/regex/regex.php?page=3

Basic Syntax of Regular Expressions (as from PHPBuilder.com)
First of all, let’s take a look at two special symbols: ‘^’ and ‘

. What they do is indicate the

start and the end of a string, respectively, like this:
“^The”: matches any string that starts with “The”;
“of despair$”: matches a string that ends in the substring “of despair”;
“^abc$”: a string that starts and ends with “abc” — that could only be “abc” itself!
“notice”: a string that has the text “notice” in it.
You can see that if you don’t use either of the two characters we mentioned, as in the last example,
you’re saying that the pattern may occur anywhere inside the string — you’re not “hooking” it to any of the edges.
There are also the symbols ‘*’, ‘+’, and ‘?’, which denote the number of times a character or a sequence of
characters may occur. What they mean is: “zero or more”, “one or more”, and “zero or one.” Here are some examples:
“ab*”: matches a string that has an a followed by zero or more b’s (“a”, “ab”, “abbb”, etc.);
“ab+”: same, but there’s at least one b (“ab”, “abbb”, etc.);
“ab?”: there might be a b or not;
“a?b+$”: a possible a followed by one or more b’s ending a string.
You can also use bounds, which come inside braces and indicate ranges in the number of occurences:
“ab{2}”: matches a string that has an a followed by exactly two b’s (“abb”);
“ab{2,}”: there are at least two b’s (“abb”, “abbbb”, etc.);
“ab{3,5}”: from three to five b’s (“abbb”, “abbbb”, or “abbbbb”).
Note that you must always specify the first number of a range (i.e, “{0,2}”, not “{,2}”). Also, as you might
have noticed, the symbols ‘*’, ‘+’, and ‘?’ have the same effect as using the bounds “{0,}”, “{1,}”, and “{0,1}”,
respectively.

Basic Syntax of Regular Expressions (as from PHPBuilder.com)First of all, let’s take a look at two special symbols: ‘^’ and ‘

. What they do is indicate thestart and the end of a string, respectively, like this:
“^The”: matches any string that starts with “The”;”of despair$”: matches a string that ends in the substring “of despair”;”^abc$”: a string that starts and ends with “abc” — that could only be “abc” itself!”notice”: a string that has the text “notice” in it.You can see that if you don’t use either of the two characters we mentioned, as in the last example,you’re saying that the pattern may occur anywhere inside the string — you’re not “hooking” it to any of the edges.
There are also the symbols ‘*’, ‘+’, and ‘?’, which denote the number of times a character or a sequence ofcharacters may occur. What they mean is: “zero or more”, “one or more”, and “zero or one.” Here are some examples:

“ab*”: matches a string that has an a followed by zero or more b’s (“a”, “ab”, “abbb”, etc.);”ab+”: same, but there’s at least one b (“ab”, “abbb”, etc.);”ab?”: there might be a b or not;”a?b+$”: a possible a followed by one or more b’s ending a string.You can also use bounds, which come inside braces and indicate ranges in the number of occurences:
“ab{2}”: matches a string that has an a followed by exactly two b’s (“abb”);”ab{2,}”: there are at least two b’s (“abb”, “abbbb”, etc.);”ab{3,5}”: from three to five b’s (“abbb”, “abbbb”, or “abbbbb”).Note that you must always specify the first number of a range (i.e, “{0,2}”, not “{,2}”). Also, as you mighthave noticed, the symbols ‘*’, ‘+’, and ‘?’ have the same effect as using the bounds “{0,}”, “{1,}”, and “{0,1}”,respectively.