Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Search and replace not working properly ...

    Help wanted · · · – – – · · ·
    5
    9
    13526
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Hakim Oerton
      Hakim Oerton last edited by

      I have for months been successfully transferring text from PDF documents to N++ and stripping the CR&LF that appears after each word by searching for \r\n and replacing with \s with the extended option ticked.
      Yesterday this stopped working. I deleted my install and downloaded the latest version to find the same problem which is that the CR&LF are replaced by a literal \s inserted before each word.
      Any idea of what is happening here?

      1 Reply Last reply Reply Quote 1
      • Hakim Oerton
        Hakim Oerton last edited by

        Debug info is here if it is useful:
        Notepad++ v7.3.1 (32-bit)
        Build time : Jan 17 2017 - 00:21:10
        Path : C:\Program Files (x86)\Notepad++\notepad++.exe
        Admin mode : ON
        Local Conf mode : OFF
        OS : Windows 7
        Plugins : mimeTools.dll NppConverter.dll NppExport.dll NppFTP.dll PluginManager.dll

        Scott Sumner 1 Reply Last reply Reply Quote 1
        • Scott Sumner
          Scott Sumner @Hakim Oerton last edited by

          @Hakim-Oerton

          I don’t know about the “Extended” Search Mode as I have no experience with it. I see little use for it since Regular Expression mode was added in version 6.0 – my guess is that extended mode is still retained for people that are accustomed to using it.

          Why don’t you try doing your Search-and-Replace this way?:

          Find what: \r\n
          Replace with: \x20
          Mode: Regular expression

          You could enter simply a single space into the “Replace with” box, but as that would be hard to show in red above, I opted for the hex version of a single space (the \x20). Either way will work.

          1 Reply Last reply Reply Quote 1
          • Sanjay Jha
            Sanjay Jha last edited by

            Normal text search not working for me too… Find next button doesn’t show anything, while “Find all in current document” shows the occurrences correctly.

            1 Reply Last reply Reply Quote 0
            • AdrianHHH
              AdrianHHH last edited by

              Occasionally I leave the “In selection” tick box on the replace window ticked, then I get very confused about why a replace does not do what I want. Unticking the “In selection” box and shouting at my mouse for clicking the wrong things lets the replacement work OK.

              1 Reply Last reply Reply Quote 0
              • Vasile Caraus
                Vasile Caraus last edited by

                @Scott-Sumner said:

                \x20

                by the way, please tell me. x20 is the same thing as one space between words?

                Scott Sumner 1 Reply Last reply Reply Quote 0
                • Scott Sumner
                  Scott Sumner @Vasile Caraus last edited by

                  @Vasile-Caraus

                  @Scott-Sumner said:

                  You could enter simply a single space into the “Replace with” box, but as that would be hard to show in red above, I opted for the hex version of a single space (the \x20). Either way will work.

                  Was that unclear? or just not read?

                  1 Reply Last reply Reply Quote 0
                  • Vasile Caraus
                    Vasile Caraus last edited by

                    @Scott-Sumner said:

                    a single space into the “Re

                    hello. I read, only that I made a regex and \x20 was not working as a space.

                    Scott Sumner 1 Reply Last reply Reply Quote 0
                    • Scott Sumner
                      Scott Sumner @Vasile Caraus last edited by

                      @Vasile-Caraus

                      Create a UTF-8 document with some “word” data in it. For example, copy-n-paste the content of this posting.

                      Get to the Find dialog’s Replace tab:

                      • Find what: \w
                      • Replace with: \x20
                      • Search mode: Regular expression
                      • Wrap around: checked
                      • Uncheck all other checkboxes on Replace tab.

                      Press the Replace button one or more times. Each press replaces a word character with a single space character.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post
                      Copyright © 2014 NodeBB Forums | Contributors