• Login
Community
  • Login

regex: add new empty line after specific line

Scheduled Pinned Locked Moved General Discussion
3 Posts 2 Posters 478 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.
  • C
    cisco779k
    last edited by cisco779k Oct 5, 2022, 5:32 PM Oct 5, 2022, 5:30 PM

    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: … ?

    A 1 Reply Last reply Oct 5, 2022, 5:36 PM Reply Quote 0
    • A
      Alan Kilborn @cisco779k
      last edited by Alan Kilborn Oct 5, 2022, 5:41 PM Oct 5, 2022, 5:36 PM

      @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
      • C
        cisco779k
        last edited by Oct 5, 2022, 5:54 PM

        oh yes, work great.

        thank you so much

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