• Login
Community
  • Login

Replace specific number and letter

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 2 Posters 181 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
    Alexandros Xatzidimitriou
    last edited by May 18, 2020, 5:36 PM

    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
    • G
      guy038
      last edited by guy038 May 18, 2020, 9:32 PM May 18, 2020, 6:33 PM

      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
      • A
        Alexandros Xatzidimitriou
        last edited by May 18, 2020, 11:10 PM

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

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