Remove All Clickable links from RTF doc

84 views
Skip to first unread message

Potts Jeff

unread,
Aug 8, 2022, 11:02:02 AM8/8/22
to TextSoap
I'm working with RTF files that come populated with embedded URLs. I would like to remove the entire link, including the text included in the link. This is a small example of the text.
------------------------------------------------------------------------------------------------------------------

[Popular Music 2017-oct 09 vol. 36 iss. 3] Cleeve, Sam - Consuming Music in the Digital Age_ Technologies, Roles and Everyday Life. By Raphaël Nowak. Basingstoke_ Palgrave Macmillan, 2 (2017) [10.1017_S0261143017000411]

Page 2:

As problematic as this self-imposed restriction may be – the relationship between one’s age and music consumption preferences arguably being more corollary than causal

------------------------------------------------------------------------------------------------------------------------------------------

I was trying to accomplish by REGEX, but can’t find a workable solution or pattern. I do not know enough about exposing the rtf codes to craft a proper solution.

What is the best way to remove all links in an RTF document?

Mark Munz

unread,
Aug 8, 2022, 1:23:27 PM8/8/22
to TextSoap
You will want to create a custom cleaner with the following actions:
image.png

Regex is useful when trying to match text, but not attributes.
For Attribute matching, you'll want to use "If Has Attribute" or (if attribute is related to font), "If Matches Font".



--
You received this message because you are subscribed to the Google Groups "TextSoap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to textsoap+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/textsoap/eba2da67-6ebb-4f08-bfb7-a3e046c99161n%40googlegroups.com.


--
Mark Munz
unmarked software
http://www.unmarked.com/

Potts Jeff

unread,
Aug 8, 2022, 5:22:48 PM8/8/22
to text...@googlegroups.com
Thanks for the tip, I never noticed those options. I must have just skipped right by them while thinking of different words for my solution. Works perfectly.


On Aug 8, 2022, at 1:23 PM, Mark Munz <unma...@gmail.com> wrote:

You will want to create a custom cleaner with the following actions:
You received this message because you are subscribed to a topic in the Google Groups "TextSoap" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/textsoap/yIByHKNAYKg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to textsoap+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/textsoap/CACc%3DZdw1A0LiLX1uwaD_hc1q6o1ofXV%3D8VaGefoRPLA-Rn2e1A%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages