Add predefined strings to existing fields across multiple cards

Regular expressions (RegEx).

You can define a capturing group with parentheses and use it in the replacement with $i, where i is the index of the group within your regular expression.

For your use case, select the notes in the Browser, go to Find & Replace, select the field and “Treat input as regular expression”, then insert the following:

image

Find: (.*)

  • translates to “Match a string of any length (as long as possible) with any characters (except newlines) and store it.”
    • to include newlines, you could use ([\S\s]*).

Replace: [sound:$1]

  • references the stored group with $i
2 Likes