• Login
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.
  • A
    Alec Tell
    last edited by Jan 26, 2018, 6:20 PM

    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

    S 1 Reply Last reply Jan 26, 2018, 6:32 PM Reply Quote 1
    • S
      Scott Sumner @Alec Tell
      last edited by Scott Sumner Jan 26, 2018, 6:34 PM Jan 26, 2018, 6:32 PM

      @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
      • A
        Alec Tell
        last edited by Jan 26, 2018, 6:52 PM

        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
        3 out of 3
        • First post
          3/3
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors