在php中突出显示包含无效字符的单词

How to highlight word containing not allwowed character in php

Below is code to find error in a sting $noticeText

function AddressOnlyValidatorNoticeTemp($str_fieldValue)
{
    $str_pattern = '/[^A-Za-z0-9 #.,:()%?!^[@\]*{}\/&_-\\s]/'; // 25-08-2010
    preg_match_all($str_pattern, $str_fieldValue,$matches);
    if($matches[0] != null)
    {
        $message = "Only 'A-Z a-z 0-9 # . , ( ) & % ? [ ] @ * { } _ / -' Characters Allowed";
    }
    else
    {
        $message = 1;
    }

    return $message;
}

if (!$errFlag)
{
    $errMsg = AddressOnlyValidatorNoticeTemp($noticeText);
    if ($errMsg != 1)
    {   
        $errMsg = "Notice Details : ".$errMsg;
        $errFlag = true;
    }
}

My issue is how to highlight word containing character not allowed in $str_pattern.

Thanks