Community
    • Login

    Add delimiter - simple but not for begginer

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 1.3k 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.
    • Alec TellA Offline
      Alec Tell
      last edited by

      Hello,
      I spend few hours looking for an answer, but didn’t find the solution. The idea how regular expressions works is too blur for me at this moment.
      I have a text like this : &&&&#&&Dublin1$$$$$#London2##$$$$Birmingham3$###
      Similar strings in each line, few hundred lines. I wanted to get string like that: Dublin1,London2,Birmingham3 - letter and digit combinations with delimiter added.

      In n++ I pressed Ctrl+H, in find field give regular expression (and marked the option of regular expressions): [a-zA-Z0-9]{1,15}
      But in the filed Replace I put many things from examples, like \1 etc. No result.

      Will be thankful for any help.

      Best regards,
      Alec

      Scott SumnerS 1 Reply Last reply Reply Quote 1
      • Scott SumnerS Offline
        Scott Sumner @Alec Tell
        last edited by Scott Sumner

        @Alec-Tell :

        I would try:

        Find what: \W+
        Replace with: ,

        Meaning find a run of one or more NON-word characters and replace them with a comma.
        Word characters are [A-Za-z0-9_] so NON-word means everything else.
        Note the W is capitalized; that’s key to NON-word.

        1 Reply Last reply Reply Quote 2
        • Alec TellA Offline
          Alec Tell
          last edited by

          Thank you, looks so simple and elegant that makes me think where my “open minded” has gone.
          Will try it.

          1 Reply Last reply Reply Quote 1

          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