perldoc perlre In particular the following metacharacters have their standard egrep-ish meanings: \ Quote the next metacharacter ^ Match the beginning of the line . Match any character (except newline) $ Match the end of the string of the string) | Alternation () Grouping [] Bracketed Character class