>oops. The expression should read '/\[([^\]]+)\]/'

Thanks all, i used this code and it works:

        preg_match("/\[(.+)\]/",$msg_array[$i],$segments);
        $title = trim($segments[1]); 
        $description = ereg_replace("\[ $title \]", "", $msg_array[$i]);

Does anyone know a good regex tutorial? I'll probably bump into it again.
Regex'es seem to be very usefull.

Regards,

Jeroen Geusebroek

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to