Community
    • Login

    Help with Regex Search and Replace

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

      Hello! I’m trying to fix and neaten some code and what I’d like to be able to do is a global search and replace which replaces:

      ABC#########WXYZ with ABCWXYZ#########

      There may be between four and nine numbers in the ########## though I don’t mind having to run it once for each possible quantity of numbers.

      ABC WXYZ are all letters and in caps. ABC is the same for each group, but WXYZ can be different.

      the # signs are always representing numbers, and the numbers and letters need to stay the same, just be in a different order.

      Can any expert out there help me with this?

      Thanks!

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse @rderekp
        last edited by

        @rderekp

        If I understand correctly you are looking for: (ABC)(\d{4,9})([A-Z]{4})
        and replace with:\1\3\2
        Make sure you have checked regular expression in replace dialog.

        1 Reply Last reply Reply Quote 1
        • rderekpR
          rderekp
          last edited by

          You are my hero! It looks like this fixed my problem, thank you!

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