Community
    • Login

    Add delimiter - simple but not for begginer

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 1.0k 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.
    • Alec TellA
      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
        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
          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
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors