Remove weblink (in plain text, no hyperlinks!) from variable (text)

Hello! I would like to find and replace weblinks (with a custom replacement text) from a plain text (inside a variable), leaving all other text around that weblink the way it is. The reason: I use text to speech a lot but i'm listening to long weblinks that are found in the text.

Example input (variable, plain text):
" These words I would like to keep after the processing, but this weblink www.nonexistentweblinkjksd.com/762hjsdjh8273878-672367sdh needs to go"

desired output of example:
" These words I would like to keep after the processing, but this weblink [customreplacementtext] needs to go"

all weblinks i use have "www" in them, so maybe with that information I could remove that whole 'word' (namely the complete weblink which of course has no spaces in it). Of course other suggestions that get the job done are very much appreciated.

Thanks in advance, greetings from Amsterdam

You’ll likely want to use RegEx search and replace action with a pattern that matches a URL (google that for examples), and get the action to store it back to the source.

So a pattern of "three ws then zero or more characters that aren't a space": www[^\s]*

Search and Replace www.kmactions (627 Bytes)

image

1 Like

Works like a charm, thanks a lot‼️