if($text =~ /Page (?: |\W)+ 1 (?: |\W)+ of (?: |\W)+ (\d+)/x) { print "\n\nNumber of Pages: $areaCode$1\n\n"; }