Community
    • Login

    Find and replace text with regex

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 341 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.
    • PeggoC82P
      PeggoC82
      last edited by

      I have the following problem and I hope you can help me with the following problem.

      I would like to use Notepad++ to find texts that look like this:

      { 1000000013;1;Column;Salesperson Code;
      { 1000000014;1;Column;Country/Region Code ;
      { 1000000019;1;Column;VATRegistrationNo. ;
      

      these texts are to be replaced in such a way that everything that follows Column; contains only letters and numbers, except for the concluding semicolon.

      So the result should look like:

      { 1000000013;1;Column;SalespersonCode ;
      { 1000000014;1;Column;CountryRegionCode ;
      { 1000000019;1;Column;VATRegistrationNo ;
      

      I have already tried it with regex, but unfortunately without success so far.

      Does anyone have an idea for me how I can best realise this?

      Alan KilbornA 2 Replies Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @PeggoC82
        last edited by

        @PeggoC82

        It is always discouraging, for someone that wants to reply to a question such as yours, to see inconsistencies in the before/after text, and/or in the description of what is wanted.

        In your case, in your first line of your “after” text, you have a space in front of the final semicolon, but no space there in your “before” text. Is this just sloppiness on your part (thus, discouraging) or is this something you want the operation to do for you (insert that space)?

        1 Reply Last reply Reply Quote 0
        • Alan KilbornA
          Alan Kilborn @PeggoC82
          last edited by Alan Kilborn

          @PeggoC82

          Regardless, this is a now-classic “replacing in a specific zone of text” problem, and we have a solution for that; reference HERE to get started and post back again if you need further help.

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