Twitter feed - removing url - confusion

So i’ve checked the “remove URL” but when the twitter feed displays, I see the “bit.ly” or the “pic.twitter.com” link at the end of the tweet? Is this the URL its supposed to be removing? or does it have to have http://. or not sure what exactly.

Basically its very difficult to remove a URL effectively - the current method relies on the URL having http on it to begin with.

In technical terms, the regex we use at the moment is:

((https?|ftp|gopher|telnet|file|notes|ms-help):((\/\/)|(\\))+[\w\d:#\@%\/;$()~_?\+-=\\.&]*)

And I am very happy to take improvements :smile:

ah. ok. I am not a regex coder or a programmer, but I did find this page where people have asked the same question about the twitter feed and there was some coding for regex (at least I think so)
Maybe it will help. - I


(FYI there is a space added so it would accept the link)
i tried pasting the best replies but im only allowed 1 url as i’m a new user.

So that is suggesting that we replace our regex with this monster one

~(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?«»“”‘’]))~

I’ve written up an enhancement issue to look at it: https://github.com/xibosignage/xibo/issues/703 which includes the location in the code that you will need to paste in the new regex if you want to try it out