Replaced str_ireplace with preg_replace in replace_everything_but_nouns_with(). str_ireplace() did not do the job.