Just like the gold farmers on MMO’s, they’ll just use special characters and spaces to circumvent it and the legitimate players trying to share something fun like a YT or Twitch link will get pissed off. Best solution is moderation; clear chat and ban when it occurs.
You can’t 100% prevent people from posting links/ip’s, this is trying to alert mods for an action. This also prevents people from visiting dangerous sites.