Community
    • Login

    regex - add a new line at the beginning after every point | cut sentences in new line

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 1.2k 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.
    • Neculai I. FantanaruN
      Neculai I. Fantanaru
      last edited by

      good day. I have many sentences in a single line. For exemple:

      I go home. My mother is with my sister. I love Pepsi. I need somebody to love me. I have to make some exercises.
      

      My desire output:

      I go home. 
      My mother is with my sister.
      I love Pepsi.
      I need somebody to love me.
      I have to make some exercises.
      

      My solution is:

      Search: [=.:].*
      Replace by: \n$0

      But is not quite very best solution, because it brings also the point at the beginning of the new line.

      1 Reply Last reply Reply Quote 0
      • dinkumoilD
        dinkumoil
        last edited by

        Search for: \. + (literal full stop with one or more trailing space characters)
        Replace with: .\r\n (full stop with trailing CR+LF)

        1 Reply Last reply Reply Quote 1
        • Neculai I. FantanaruN
          Neculai I. Fantanaru
          last edited by Neculai I. Fantanaru

          @dinkumoil said:

          .\r\n

          and if there are many special characters instead of point, such as =:* ? How can I change it?

          For example:

          I go home= My mother is with my sister: I love Pepsi. I need somebody to love me* I have to make some exercises*
          
          1 Reply Last reply Reply Quote 0
          • dinkumoilD
            dinkumoil
            last edited by

            Search for: ([.:=*]) +
            Replace with: \1\r\n

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