editor: batch replace in one field, also with regex

AnkiWeb addon 356095608

Applies user-defined plain-text and regular-expression replacements in batch, via a configurable shortcut, to the HTML source of the currently active editor field.
AI-generated summary; may contain mistakes.

note-management

Open on AnkiWeb Forum topic Find alternatives

AnkiWeb

Votes
12 (πŸ‘ 11 Β· πŸ‘Ž 1)
Updated
2023-12-24
Anki versions
23.10.1~
License
AGPL-3.0 (from the headers of the Python files)
Virus scan
No ClamAV match A match does not prove malware. No match does not prove that the code is safe.
Languages
Python, JSON
Description language
en

Maintenance

abandoned

  • Last update or commit: 2023-12-24 (1043 days before the snapshot).

GitHub

No GitHub repository linked.

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
2.1.3523.10.1+2023-12-24
History across monthly snapshots

Loading…

Similar addons

Description

You should adjust or at least check the default shortcut in the addon config. It's difficult to find a shortcut that works for everyone: Windows and Mac have different built-in OS shortcuts and there are hundreds of addons with their own shortcuts. Keep in mind that on MacOS setting "Ctrl" in the addon config means that you actually need to use "Cmd".

This add-on allows you to define a list of replacements and gives you a shortcut to apply all of these substitutions/replacements on the currently active field of the editor. Actually it's two lists: plain text and regular expressions.

How this add-on works: -These replacements refer to the html source code of a field and not what you actually see. -My add-on uses python's re.sub (regular expression matching operations similar to those found in Perl) to apply the regex replacements.

The code for the configuration window is taken from the great add-on Symbols As You Type by github.com/jefdongus.

For batch replacements there's also the built-in find and replace functionality as well as glutanimate's Batch Editing.

These do the opposite: They allow you to change
     one thing about multiple fields and multiple notes
whereas my add-on is about changing
     multiple things in one field in one note.

If you find a bug let me know in the ankiweb forum (click the "Contact Author" button in the upper right of this window).

 

# Versions

  • 2023-12-24 fix for 23.10.1 or newer
  • 2022-08-16 fix context menu entry, prefill dialog with selected text from editor
  • 2021-12-18 fix bug reported in the forum
  • 2021-12-11 fix for 2.1.50/qt6, replace longer strings first, option to remove most frequent abbreviation
  • 2021-01-23 initial release