in reply to Reguar expression

I, too, think the OP smells of homework, but since others have chimed in, here's my contribution of a regex (but it doesn't handle enclosing double-quotes, left as an exercise for the OPer – perhaps another post?):
>perl -wMstrict -le "my $rx = qr{ \A (?! (?i) .* \bfirst\b ) This .* \. \z }xms; print '----- output -----'; for my $str (@ARGV) { print $str, $str =~ $rx ? ' M' : ' No M', 'atch'; } " "This is first sentence." "This is second sentence." "This is the First Lady." "This is the firstborn." ----- output ----- This is first sentence. No Match This is second sentence. Match This is the First Lady. No Match This is the firstborn. Match