• Login
Community
  • Login

Wildcard Search and Replace

Scheduled Pinned Locked Moved General Discussion
3 Posts 2 Posters 343 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
    Andrew 0
    last edited by Aug 20, 2020, 8:44 PM

    Hello.

    I am trying to find any field that is 16 digits long that starts with 123456 and replace it with 123456XXXXXXXXXX.

    Here is a snapshot of what I am trying to accomplish.

    9a6b24de-d148-4369-a6e9-19939b4d5092-image.png

    I tried 123456.*, but it replaced everything to the right of that field. I just need that specific field updated.

    Any assistance you could provide would be appreciated. Thanks.

    P 1 Reply Last reply Aug 20, 2020, 8:46 PM Reply Quote 1
    • P
      PeterJones @Andrew 0
      last edited by PeterJones Aug 20, 2020, 8:47 PM Aug 20, 2020, 8:46 PM

      @Andrew-0 ,

      Very close. The * quantifier means “0 or more”. What you want is a quantifier that gives an exact number of digits… in this case, 123456.{10}, which says “123456 followed by exactly 10 other characters”.

      You might change it to 123456\d{10}, which says “123456 followed by exactly 10 numerical digits”.

      ----
      Regex Docs:

      • official NPP Searching / Regex docs
      • the forum’s Regular Expression FAQ.
      1 Reply Last reply Reply Quote 2
      • A
        Andrew 0
        last edited by Aug 20, 2020, 8:49 PM

        Holy Snikies!

        Thank you so much. I have been searching high and low for that solution. Appreciate it!

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