Errrr....

$regex(%line,/(\b(www.?\.|https?:\/\/|ftp:\/\/|unreal://\/\/).)/i)

You escape the slashes in https:// and ftp:// but not in [url=unreal://.][url=unreal://.][url=unreal://.]unreal://.[/url][/url][/url] Remove the first two slashes, which I assume you forgot to delete.