\w word character \W non-word character \s space character \S non-space character \d digit character \D non-digit character ^ beginning of string $ end of string . any character [xyz] character set | alternatives Quantifiers * zero or more + 1 or more ? 0 or 1 {M} exactly M {M,N} between M and N characters /pattern/i - case insensitive match $line =~ tr/ABC/XYZ/; # replaces all A's with X's, B's with Y's C's with Z's $line =~ tr/[a..z]/[A..Z]/; # capitalizes all letters $line =~ s/human/HOMO/; # replaces the first occurence of "human" with "HOMO" $line =~ s/\s//g; # strips off all spaces