• Login
Community
  • Login

Regex: Remove space of unfinished sentences whose words continue on a new line

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 3 Posters 435 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.
  • H
    Hellena Crainicu
    last edited by Hellena Crainicu Feb 2, 2022, 7:06 AM Feb 2, 2022, 7:04 AM

    hello. I have some unfinished sentences whose words continue on a new line. See the print screen below.

    So, I need to link those words again in the same sentence, in continuation of that line.

    Untitled.png

    So, I made a regex:

    FIND: \s\R
    REPLACE BY: \x20

    The only problem is that my regex will bring absolutely all the lines closer together, even the paragraphs.

    N 1 Reply Last reply Feb 2, 2022, 10:15 AM Reply Quote 0
    • G
      guy038
      last edited by Feb 2, 2022, 9:26 AM

      Hello @hellena-crainicu,

      Please, instead of a picture, could you provide us raw text, in reverse video, like below :

      Text to analyse
      

      Thanks,

      BR

      guy038

      H 1 Reply Last reply Feb 2, 2022, 2:02 PM Reply Quote 0
      • N
        Neil Schipper @Hellena Crainicu
        last edited by Feb 2, 2022, 10:15 AM

        @hellena-crainicu This exact problem was recently solved here.

        H 1 Reply Last reply Feb 2, 2022, 2:06 PM Reply Quote 1
        • H
          Hellena Crainicu @guy038
          last edited by Hellena Crainicu Feb 2, 2022, 2:02 PM Feb 2, 2022, 2:02 PM

          Please, instead of a picture, could you provide us raw text, in reverse video, like below :

          Text to analyse
          

          Starting the point luate de (from this point starts the problem)

          Considerat ca parte umilă a artei, „rnește-șugnl“, atît de respectat odinioară, a fost dat uitării, cu timpul, in mod imprudent. în prezent, mulți se întorc la el, înțelegînd insuficiența experiențelor izolate, a „pornirii de Ia zero“ ca îs Robinson pe insula sa și a micilor rețete luate de
          ici, de colo, al căror efect strălucitor are consecințe triste. Aceasta pentru că epoca noastră,

          1 Reply Last reply Reply Quote 0
          • H
            Hellena Crainicu @Neil Schipper
            last edited by Feb 2, 2022, 2:06 PM

            @neil-schipper

            @hellena-crainicu This exact problem was recently solved here.

            SUPER ANSWER. Your solution is great:

            FIND: (?<=[^\r\n])\R(?=[^\r\n])

            Also, the one made by @guy038 is super:

            FIND: (?<!\n|\r)\R(?!\R)

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