Macro to remove Anki clozes

Hi, I would like help to build a macro that removes the clozes using an app called Anki, like this:

We're still in the infancy of {{c1::understanding neural development}}. One thing is becoming clear, we can {{c3::make significant changes in our brain}} by {{c2::changing how we think}}.

I managed to build the regex capable of doing this: https://regex101.com/r/JoFDbl/1, but I'm having difficulty to implement it in a macro that copies the text and returns it without the clozes.

The curly brackets are upsetting the search for some reason. I tried

\{\{c.::(.+?)\}\}

and it seems to achieve what you want. Also, when I've used search and replace I've always used the $ to indicate captured groups, not the backslash. Having said that it seems $1 works just as well as \1 !!

1 Like

It worked perfectly, thanks.

1 Like