1

For example, I wanna search and replace all the "\d" (a command defined by myself). But if I type it in the search bar, then all commands containing it pop up, such as "\Di" and "\dot". So how can I search and replace the commands(or words) exclusively?

PS: I'm using Texpad(MacOS) as the editor(following is a screenshot). If it does not support such a exclusive search and replacement, any other recommendation would be appreciated.

enter image description here

  • 2
    The regex \\d[^\w^\\] should match a \d followed by anything except a letter, number or backslash. But I don't know if your editor supports regex search. – campa Feb 04 '21 at 12:05
  • Thanks for your recommendations! I have find that VS code is a also good editor for latex, and the exclusive search can be achieved by "Match Whole Word" and regular expression(which is even more powerful such that you can replace the whole environment). – Varnothing S Feb 04 '21 at 15:39

1 Answers1

3

In Texmaker you can choose a "Case sensitive" search mode and you might want to try and search for "\d " instead of "\d".
The additional blank space ensures that it only is "\d" alone.