AnsweredAssumed Answered

Removing Multiple image and URL references of varying length within large text string

Question asked by garyjones on Feb 6, 2019
Latest reply on Feb 7, 2019 by garyjones

Hi,

 

I have a parsed email text string consisting of multiple blocks of text at the end of which are references to [image:Twitter], [image:Facebook] and sometimes [image: Google Plus] each of which is followed by a URL reference (see below) -

 

"[image: Google+]

<http://scholar.google.co.uk/scholar_share?hl=en&oi=scholaralrt&ss=gp&url=https://journals.plos.org/plosone/article%3Fid%3D10.1371/journal.pone.0204215&rt=Experiences+from+a+multimodal+rhythm+and+music-based+rehabilitation+program+in+late+phase+of+stroke+recovery%E2%80%93A+qualitative+study&scisig=AAGBfm1MsKilACZ-WsLcBN9IzP1-prWl9A>

[image:

Facebook]

<http://scholar.google.co.uk/scholar_share?hl=en&oi=scholaralrt&ss=fb&url=https://journals.plos.org/plosone/article%3Fid%3D10.1371/journal.pone.0204215&rt=Experiences+from+a+multimodal+rhythm+and+music-based+rehabilitation+program+in+late+phase+of+stroke+recovery%E2%80%93A+qualitative+study&scisig=AAGBfm1MsKilACZ-WsLcBN9IzP1-prWl9A>

[image:

Twitter]

<http://scholar.google.co.uk/scholar_share?hl=en&oi=scholaralrt&ss=tw&url=https://journals.plos.org/plosone/article%3Fid%3D10.1371/journal.pone.0204215&rt=Experiences+from+a+multimodal+rhythm+and+music-based+rehabilitation+program+in+late+phase+of+stroke+recovery%E2%80%93A+qualitative+study&scisig=AAGBfm1MsKilACZ-WsLcBN9IzP1-prWl9A>"

 

I would like to remove all references to the images, the URL text that follows each and replace the last with a ¶ as part of an auto-enter calc on a text field. Note, that prior to and after each similar text string is text I wish to keep.

 

It's easy to remove the image references using -

 

Substitute ( Self ; ["[image:"; ""]; ["Facebook]"; "¶"];["Twitter]"; "¶"];["Flag";""];

["as irrelevant"; "¶"];["Google Plus";"¶"])

 

It's not unreasonable to assume that the line break after ":" and prior to "Facebook" or "Twitter" may not always exist so wanted to create a catch-all for each instance.

 

However, I can't work out how to remove the URL text that follows the length of which will always vary. I've tried Word count etc but to no avail.

 

All help appreciated as always.

 

Thanks

 

Best wishes

 

Gary

Outcomes