• Login
Community
  • Login

RegEx... Exchange

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
7 Posts 4 Posters 314 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.
  • T
    Thomas 2020
    last edited by Jul 25, 2020, 4:56 PM

    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…

    P 1 Reply Last reply Jul 25, 2020, 5:11 PM Reply Quote 0
    • P
      PeterJones @Thomas 2020
      last edited by Jul 25, 2020, 5:11 PM

      @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
      • T
        Thomas 2020
        last edited by Jul 25, 2020, 6:57 PM

        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 ?

        P 1 Reply Last reply Jul 25, 2020, 7:02 PM Reply Quote 0
        • P
          PeterJones @Thomas 2020
          last edited by Jul 25, 2020, 7:02 PM

          @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
          • T
            Thomas 2020
            last edited by Thomas 2020 Jul 25, 2020, 7:20 PM Jul 25, 2020, 7:19 PM

            I don’t have a \R

            Schowek01.jpg

            I have to deal with \n

            A 1 Reply Last reply Jul 25, 2020, 9:28 PM Reply Quote 0
            • T
              Terry R
              last edited by Jul 25, 2020, 7:50 PM

              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
              • A
                astrosofista @Thomas 2020
                last edited by Jul 25, 2020, 9:28 PM

                @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
                2 out of 7
                • First post
                  2/7
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors