How to remove hyperlinks from message object

artistical's icon

Hi there,

I am using the mxj searchtweet object to pull twitter feeds into max.
Does anyone know how to remove hyperlinks from a message object?
I have been using the regexp object to remove the symbols cannot figure out how to remove the full hyperlinks.

For example for this tweet:
"#millennials want #e2016 candidates who willchange most @obama policies http://t.co/wj0s9b8scs @theweek #boomers #teen #genx #teaparty #ows"

I would like to read:
"#millennials want #e2016 candidates who willchange most @obama policies @theweek #boomers #teen #genx #teaparty #ows"

Max Patch
Copy patch and select New From Clipboard in Max.

Thank you for the help!!

broc's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Like this?

artistical's icon

cool thanks! Works perfectly.

If you don't mind, how do the meta characters you put in the regexp work in layman's terms?

regexp http[^\\s]+\\s @substitute %0

artistical's icon

Hi Broc,
I noticed that the first part of any tweets with a comma (,) in the text gets removed using the patch you shared.

Example: Obama returns to father's homeland with history, security on his mind: By Jeff Mason WASHINGTON (Reuters... #news

Becomes: security on his mind: By Jeff Mason WASHINGTON (Reuters... #news

Do you know why this is happening?
Thank you again!!!

broc's icon

Comma in a message box has the special meaning that parts are sent sequentially (see also help file).
So the part before comma may be overwritten by sending the next part after comma.

artistical's icon

arh I see, thanks Broc! I appreciate the help.