Search code examples
intellij-ideareplacenon-printing-characters

Search for non-printable characters (Carriage Return, Tab, etc.) in code editor of IntelliJ?


In the code editor of IntelliJ 2018, using either menu item:

  • Edit > Find > Find…
  • Edit > Find > Replace…

enter image description here

…how can I find invisible (non-printing) characters?

I am referring to characters such as:


Solution

  • Enabling "Regex" checkbox, you can use the full regex syntax. I was able to search for spaces with \u0020 and for LF with \x0a.

    • Carriage return and line feed match \r and \n respectively.
    • Arbitrary Unicode character syntax: \uFFFF, where FFFF is a hex Unicode character code.
    • Arbitrary ASCII character syntax: \xFF, where FF is an ASCII hex code.