Community
    • Login

    help about this regex

    Scheduled Pinned Locked Moved General Discussion
    regex
    6 Posts 4 Posters 343 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.
    • namx3249N
      namx3249
      last edited by

      hi everybody,

      i’ve make my first simply regex
      find: (?-s)(.*\r?\n){5}\K
      replace: \n\n\n

      this code insert 3 blank lines each 5 text lines
      but need to have the caret at the at the beginning of the first line of entire document … when i run another macro i have the caret to EOF and regex does not work
      so, how to edit this regex to work also with caret on EOF ?

      Alan KilbornA 2 Replies Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @namx3249
        last edited by

        @namx3249 said in help about this regex:

        replace: \n\n\n

        Be careful, there…you may not get the line-endings you truly want…or maybe you will; not sure of your intention.

        1 Reply Last reply Reply Quote 1
        • Alan KilbornA
          Alan Kilborn @namx3249
          last edited by

          @namx3249 said in help about this regex:

          how to edit this regex to work also with caret on EOF ?

          You can’t build the “starting point” into the find expression.
          If you want to do the whole document at once (top to bottom), then checkmark Wrap around and use Replace All.

          If it is to be part of a macro, putting Ctrl+Home in the macro before the replacement is also an option, I suppose.

          SunadeS 1 Reply Last reply Reply Quote 2
          • namx3249N
            namx3249
            last edited by namx3249

            oh nice !
            Wrap around solved my issue.
            thank you for the tip, Alan

            KirenK 1 Reply Last reply Reply Quote 1
            • SunadeS
              Sunade @Alan Kilborn
              last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • KirenK
                Kiren @namx3249
                last edited by

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