Simple Example of Perl Regular Expression:
------------------------------------------
apple -> will match 'apple tree', 'apples', 'pineapple' ... any text containing 'apple'
^ -> match start of text
$ -> match end of text
^apple$ -> match the whole word 'apple'
. -> match any single character
.* -> match 0 or more characters
.+ -> match 1 or more characters
.? -> match 0 or 1 character
.{n} -> match text with n characters
.{n,} -> match text with n or more characters
.{n,m} -> match text with n to m characters
(abc)* -> match blank, abc, abcabc, abcabcabc, ...
(abc)+ -> match abc, abcabc, abcabcabc, ...
[abcd] -> match a, b, c or d
[^abc] -> match any single character except a, b, c
\d -> match any single digit 0,1,2,...9
\D -> match any non-digit character
\w -> match any single word letter a,b,c...z,A,B,C,...Z
\W -> match any non-word letter
\s -> match space, table or return
\S -> match any character except space, table, return
\d+ -> match one or more digits
\w* -> match 0 or more word letters
a|b -> match a or b
\t -> match table
\n -> match return
------------------------------------------
Refer to http://perldoc.perl.org/perlre.html if you want to learn more about Perl Regular Expression.