Community
    • Login

    Need help on replacing multiple spaces to a single space using Regular Expression

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 8.9k 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.
    • George FanG
      George Fan
      last edited by

      Hi everyone,
      I’d like to ask for help on how to replace multiple spaces between words into a single space in a txt file like below:

      Nice to meet you!
      ->
      Nice to meet you.

      I’m sure there is a certain way in Regular Expression that is able to accomplish this function but don’t know where to start or how to write the expression in the “Replace” box.

      Is there anyone who have any idea?
      Thanks in advance and appreciate for your suggessions.

      Regards,
      George

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Scott SumnerS
        Scott Sumner @George Fan
        last edited by

        @George-Fan

        Put a single space followed by a + in the Find what box. Select Regular expression search mode and press Find Next. You will see the results and should be able to build on that to do your desired replacement.

        1 Reply Last reply Reply Quote 0
        • George FanG
          George Fan
          last edited by

          That works, thank you so much Scott :-)

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