What Are the Special Symbols That Need to Be Escaped, and How to Escape Them All at Once?

I don’t want to manually add the symbol "\" in front of them one by one every time.

I often use Keyboard Maestro to find and replace mathematical formulas that are recognized by the machine as shown in the figure below.

This is the macro I use. I don’t mind using other software:

It is not clear if you are asking fo help, or already have a solution.
But if you are asking "[What Are the Special Symbols That Need to Be Escaped, and How to Escape Them All at Once? ", then I will offer these suggestions:

  1. If you are using KM Variables as your source data in any way, then turn OFF Text Processing in the KM Action:
  2. If you need to use RegEx on the source string that contains RegEx metacharacters, then you can use this Action to escape those characters:

ACTION to Escape Regex Meta Characters

(originally published by @DanThomas here.)

Search and Replace.kmactions (808 B)
Note: This is an Action upload, which will immediately and without notice insert into your currently active Macro in the KM Editor on your Mac, when you import this Action.

Apply this Action to the Source String before you make any further Search or Search and Replace Actions.

1 Like