Community
    • Login

    Replace specific number and letter

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 369 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.
    • Alexandros XatzidimitriouA Offline
      Alexandros Xatzidimitriou
      last edited by

      Hello
      ‘Blue1’: ‘0010001000100011’,
      ‘Orange1’: ‘1000100010001000’
      I want to replace number 1 with letter a but I don’t want to change Blue1 and Orange1 text.
      If I use
      Find: \d(‘1)
      Replace: a
      the first number ‘1 and the last number 1’ doesn’t change because there is this symbol (’)… Any solution…? Thanks

      1 Reply Last reply Reply Quote 0
      • guy038G Offline
        guy038
        last edited by guy038

        Hello @alexandros-xatzidimitriou, and All,

        Do you mean this kind of replacement ? :

        • Initial text :
        'Blue1': '0010001000100011',
        'Orange1': '1000100010001000'
        
        • SEARCH 1(?!':)

        • REPLACE a

        • Final text :

        'Blue1': '00a000a000a000aa',
        'Orange1': 'a000a000a000a000'
        

        Notes :

        • The search regex looks for a 1 digit, ONLY IF NOT  followed with the string ': and replaces it with the lowercase letter a

        • The (?!.......) syntax is a negative look-ahead structure

        Best Regards,

        guy038

        1 Reply Last reply Reply Quote 4
        • Alexandros XatzidimitriouA Offline
          Alexandros Xatzidimitriou
          last edited by

          Thanks a lot guy038! This is exactly what I was looking for!!!

          1 Reply Last reply Reply Quote 2

          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