Multiline search and replace
I am trying to replace (in Anki 2.1.22) <a [^>]*href="([^"]+)"[^>]*?>(.*?)</a>
with [<span class="linklike">\2</span>](\1)
But it doesn't work in this case. Apparently it's because of the line break:
the <a href="/archives/polnotes.html">daily
political notes</a>.
Is there a way?
Comments are closed, but you can start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Damien Elmes on 12 Jun, 2020 06:04 AM
In the latest alpha you can start the search with (?s) to search across newlines - maybe it'll work in older versions too.
2 Posted by Aleksej on 12 Jun, 2020 07:39 AM
Thank you, it works.
3 Posted by Aleksej on 13 Jun, 2020 11:53 PM
Hm, now pictures from the links are being lost.
4 Posted by Aleksej on 16 Jun, 2020 10:15 PM
It also loses link text.
At least this one does not:
(s?)<a [^>]*href="(?P<hrefattr>[^"]+)"[^>]*?>(?P<insidea>.*?)</a>
[<span class="linklike">\g<insidea></span>](\g<hrefattr>)