$string =~ /\A.{0,996}?html/si; [download]
In reply to Re: string pattern match, limited to first 1000 characters? by jwkrahn in thread string pattern match, limited to first 1000 characters? by ManFromNeptune