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.5k Views 2 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.
    • Neculai I. FantanaruN Offline
      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 Offline
        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 Offline
          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 Offline
            dinkumoil
            last edited by

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

            1 Reply Last reply Reply Quote 2

            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