"abcdefg" =~ /cd/ # true "abcdefg" =~ /^cd/ # anchored at start, false "abcdefg" =~ /fg$/ # anchored at end, true