How to search for special characters in Sublime Text 3

15,888

Solution 1

Sublime Text support searching by regex. http://sublime-text-unofficial-documentation.readthedocs.org/en/latest/search_and_replace/search_and_replace_overview.html

You should be able to escape the character with a backslash. "#"

Solution 2

When searching for special characters switch off the regex .* to the left of find box.

image of the find box with a red freehand circle around the ,*

Share:
15,888

Related videos on Youtube

Zelong
Author by

Zelong

Updated on September 18, 2022

Comments

  • Zelong
    Zelong over 1 year

    I have a few lines starting with the character # and I search for it in SublimeText 3, but ST3 said unable to find \b#\b.

    I then tried to search \# and it also fails (with regular expression mode enabled).

    Other characters such as & + - have the same problem.

    So how could I search for these special characters in ST3?

  • Zelong
    Zelong almost 9 years
    I disable the 'whole word' option then it works. The options seems to fail the RE as well.
  • Toto
    Toto over 5 years
    No, that is not true. You have to disable "Whole word" not regular expression. # is not a special character for regex.