How to assign the cut part of a string to a variable?

I have a snippet to remove any string between '#' and '#' from the clipboard content:

How can I modify it in order to have the removed string between '#' and '#' additionally assigned to the variable 'postponedTarget', (without the surrounding '#' characters)?

Thanks in advance!

You need a separate "Search using Regular Expression" before this Search and Replace one that uses a capture group (parentheses) to save the string to a variable before replacing it:


1 Like

Thank you very much! How nice :slight_smile: