Guys I am trying to block users under 10 posts from spamming their links help me to make this code work, I need it to block URL.tld and URL.tld/something
function badwords(&$post)
{
    global $mybb, $db;
    if($mybb->user['postnum'] > 10)
    return;
    $badwords = explode('|', 'http|https|www|com|net|org|co.uk');
    foreach($badwords as $badword)
    {
        if(preg_match("/\b$badword\b/i", $post->data['message'], $match))
        {
            $post->errors['badwords']['error_code'] = "Error message goes here";
        }
    }
    return;
}