my $re = qr{ ^ # match at the beginning. (?! # Look-ahead assertion: Fail if the next matches .* first # match "first" everywhere except at the beginning of the string ) # end of look-ahead assertion This .* \. # Match "This" (at the beginning), followed by anything and a dot $ # Match the end of a string. }x; # Allow these comments