Menu

Multiline Search & Replace?

Pictor
2009-03-25
2012-11-13
  • Pictor

    Pictor - 2009-03-25

    Hi,

    I really would appreciate the ability to use a multiline Search & Replace fields (maybe even in "Search in files").
    Or, at least, N++ could automatically convert my multiline search string to equivalent for single line.

    Example:

    I want to have this as search text
    [code]
    String for the line 1
        Tabbed string for the line 2
    [/code]
    translated in single-line expression
    [code]
    String for the line 1\n\r\tTabbed string for the line 2
    [/code]

    Is there any plugin or feature to just copy and past multiline text in the search (or replace) field and have it already correctly translated?

    I hope you understand my question (...my lazy english!).

    Thank you all!

    Pictor

     
    • cchris

      cchris - 2009-03-25

      This is covered on the wiki anyway.

      Use Ctrl-R, aka TextFX -> TextFX Quick -> Find/Replace

      Please see the wiki about using ^M to mark end of lines when the text to find doesn't have the same line endings as the file to search.

      There is a limitation however, because Ctrl-R doesn't find in folders. Then you can use Find in folders with Extended mode turned on, but the line endings must be encoded explicitly (\r\n for Windows files, \n under Unix, \r for old Mac files).
      Againn this is covered in the wiki.

      CChris

       
      • Bud Curtis

        Bud Curtis - 2009-03-25

        Could you please provide the URL for the WIKI page?

         
  • Marjan Savli

    Marjan Savli - 2010-01-19

    I use a lot this page http://notepad-plus.sourceforge.net/uk/regExpList.php

    but where in the Wiki is covered help for use characters in replace dialog "Extended"  like:  (\n, \r, \t, \0, \x…)

     
  • cchris

    cchris - 2010-01-19

    Bug:
    While searching in extended mode:
    search O: ok
    search \x4f or \x4F: not ok
    search \x10: can't find (a DOS graphic char like a cross)
    search \xaa or \xAA: not found, though char is at lune 1 of document and is shown when viewed in hex.

    CChris

     
  • cchris

    cchris - 2010-01-19

    Follow-up:
    \b, \d and \o work normally.

    CChris

     
  • aussiepics

    aussiepics - 2010-01-28

    Multiline search and replace across all open files or across all files in a directory is often the only way to keep javascript menu's up to date in frameless sites. It needs to become as simple in Notepad++ as it is in NoteTab Pro (fookes). Only reason I mention this is I love my portable apps.

     
  • cchris

    cchris - 2010-01-28

    Can you make a request on IdeaTorrent?

    CCHris

     
  • aussiepics

    aussiepics - 2010-01-30

    @CCHris; probably but I've never heard of it before, feel free to quote me on it though, if you think it will assist.

     
  • cchris

    cchris - 2010-01-30

    It will in making known the idea exists, and in alllowing other users to vote on it. The more popular, the more likely it gets to attract a dev's spare time. So it will assist, perhaps too little. I'll post your idea later tody or tomorrow - will be less active during the upcoming week.

    CChris

     
  • howgoo

    howgoo - 2010-06-23

    For example:

    Searches

    "<categoryFilters>"

    and replaces with

    "<categoryFilters>"
         <add name="Warning"/>
         <add name="Debug"/>"