Perl Programming/Regular expressions

Regular expressions are tools for complex searching of text, considered one of the most powerful aspects of the Perl language. A regular expression can be as simple as just the text you want to find, or it can include wildcards, logic, and even sub-programs.

To use regular expressions in perl, use the =~ operator to bind a variable containing your text to the regular expression:

This returns 1, if "needle" is contained within $HayStack, or 0 otherwise.

Regular expression can also be used to modify strings. You can search and replace complex patterns by using the regex format s///

($msg is now "perl is awesome")

Perl/Expressões regulares