Community
    • Login

    help about this regex

    Scheduled Pinned Locked Moved General Discussion
    regex
    6 Posts 4 Posters 711 Views 1 Watching
    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 Offline
      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 Offline
        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 Offline
          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 Offline
            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 Offline
              Sunade @Alan Kilborn
              last edited by

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

                This post is deleted!
                1 Reply Last reply Reply Quote 0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors