Community
    • Login

    RegEx... Exchange

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 4 Posters 307 Views
    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.
    • Thomas 2020T
      Thomas 2020
      last edited by

      second some -> next
      there are several files

      code…
      some block
      some block
      code…

      how to change in all like here:

      code…
      some block
      next block
      code…

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Thomas 2020
        last edited by

        @Pan-Jan ,

        https://community.notepad-plus-plus.org/topic/15739/faq-desk-request-for-help-without-sufficient-information-to-help-you

        At least try to explain the problem, or you won’t get good answers.

        Someone will probably try to tell you to look for (some block\R)some(?= block) and replace with $1next, but I have a feeling that “some” and “next” aren’t single words, and that “block” isn’t simple text. Those items will probably make any answers from your oversimplified and un-explained example not work in your case.

        1 Reply Last reply Reply Quote 1
        • Thomas 2020T
          Thomas 2020
          last edited by

          Works perfect: 1.(some block\R)some(? = block) 2.$1next
          Thank you

          I have this pattern: 1.(?:some block\R)\Ksome(?=.+) 2.next

          I thought now the pattern would be without „\R”
          How do I get rid of this \R ?

          PeterJonesP 1 Reply Last reply Reply Quote 0
          • PeterJonesP
            PeterJones @Thomas 2020
            last edited by

            @Pan-Jan said in RegEx... Exchange:

            I thought now the pattern would be without „\R”
            How do I get rid of this \R ?

            The \R means “any newline sequence”. If you want to match text that goes across multiple lines, that is the easiest way to indicate where the newline is. You could also enable . matches newline and use .*, but that has implications of that surprise people.

            1 Reply Last reply Reply Quote 0
            • Thomas 2020T
              Thomas 2020
              last edited by Thomas 2020

              I don’t have a \R

              Schowek01.jpg

              I have to deal with \n

              astrosofistaA 1 Reply Last reply Reply Quote 0
              • Terry RT
                Terry R
                last edited by

                Indeed your image above suggests that \R is not available to you. As @guy038 mentioned in one of your first posts in this forum
                https://community.notepad-plus-plus.org/topic/19649/i-would-like-to-find-lines-where-there-are-2x-double-spaces/11?_=1595705980547
                Your editor may well not have it. I can see from your image it is AkelPad which you had mentioned. Be aware that if you ask for help in this Notepad++ forum you will get answers specific to Notepad++. Don’t expect people here to help you with a different editor!

                Terry

                1 Reply Last reply Reply Quote 1
                • astrosofistaA
                  astrosofista @Thomas 2020
                  last edited by

                  @Pan-Jan said in RegEx... Exchange:

                  I don’t have a \R

                  Try \v for vertical whitespace. Perhaps it works in that editor.

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors