find/replace CRLF and TAB in CTRL-H dialog

2. Help
2006-08-28
2012-11-13
  • How can I search and replace CRLF and TAB special characters using the standard Notepad++ find/replace functionality (CTRL-H)?

    I know I can do this using the TextFx Plugin, but my target users will become confused by all the options there.

    Thanks,
       Jeff

     
    • Jimdoria
      Jimdoria
      2008-04-22

      RegEx search of CRLF doesn't work for me. Tried entering both \n\r and \r\n and searching with the "regular expression" box checked. It replied "Can't Find the word".

       
      • That's because computer actually do what you ask them to do.
        Most of the time they are not programmed to _interpret_ your questions.

        If you read the message above again, it does tell you that a search for CRLF in regex mode can't be done.

         
    • I would also like to know this

       
      • Esto esta facil para insertar un ENTER o salto de linea o CRLF uzando el find replace, pero el avansado (Ctrl + R) sale una ventana con dos cuadros de texto o list box... como sea, en el de arriba se pone el caracter o grupo de caracteres que deseas sustituir y en el de abajo colocas el caracter sustituto y le das a la tecla ENTER para que salte a la linea siguiente, con esto luego le das Find para encontrar a los primeros que seran sustituidos y le das Replace para hacer la prueba si te  funciona (como a mi) le puedes dar de una vez a Replace Rest para que lo haga con todo el documento....!!!!

         
    • pshute
      pshute
      2006-12-19

      Not sure about the tabs, but for CRLF have a read of http://notepad-plus.sourceforge.net/uk/newlineFindReplace-HOWTO.php.

       
    • You can SEARCH for tabs and CR/LF linebreaks by selecting them and opening the dialog. They selected text will be copied into the Find field. This will only work with the regular expression checkbox unchecked.

      You can (RE)PLACE tabs and CR/LF linebreaks by entering \t for a tab and \r\n for a linebreak into the Replace field and checking the regular expression checkbox.

      However, you can't search and replace CR/LF linebreaks at the same time this way.

       
      • You can, of course, use both ways to finally achieve what you want.

        Just use the normal mode to replace your text by some identifier that can be used in regex mode and then replace that identifier with some tab(s) or CRLF linebreak.