if ($source =~ /posted by (.*?) on /i) { #do something with $1 }