Community
    • Login

    regex: add new empty line after specific line

    Scheduled Pinned Locked Moved General Discussion
    3 Posts 2 Posters 1.1k 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.
    • cisco779kC Offline
      cisco779k
      last edited by cisco779k

      hi there,
      i have a multi line txt and i need to add 1 empty line after ht*ps://link

      ex:

      text_01
      text_02
      https://link_aaaa
      text_03
      text_04
      https://link_bbbb
      

      i need to have:

      text_01
      text_02
      https://link_aaaa
      
      text_03
      text_04
      https://link_bbbb
      
      text_05
      text_06
      https://link_ccc
      

      in regex find what: https://.*.
      on replace: … ?

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA Online
        Alan Kilborn @cisco779k
        last edited by Alan Kilborn

        @cisco779k

        Find: (?-s)https://.*
        Replace: $0\r\n
        Search mode: Regular expression

        Note: I fixed up your “find” expression minimally to make it work, because I don’t write expressions that depend upon the . matches newline checkbox.

        Some nice references are found HERE.

        1 Reply Last reply Reply Quote 0
        • cisco779kC Offline
          cisco779k
          last edited by

          oh yes, work great.

          thank you so much

          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