Community
    • Login

    regex: add new empty line after specific line

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

          oh yes, work great.

          thank you so much

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