Add stringp check before ppcre pattern match.