Community
    • Login

    How to extract last 23 digits from this string

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    3 Posts 2 Posters 328 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.
    • breakfreerut rutB
      breakfreerut rut
      last edited by

      I have a string
      6.4985424784218431045194480

      How can I replace the 23 digits following .49 with ;

      Terry RT 1 Reply Last reply Reply Quote 0
      • Terry RT
        Terry R @breakfreerut rut
        last edited by

        @breakfreerut-rut said in How to extract last 23 digits from this string:

        How can I replace the 23 digits following .49 with ;

        Find What:(\.\d\d)\d{23}
        with:${1};
        This is a regular expression (in case you didn’t know) and used in the Replace function you need the search mode to be regular expression.

        Note I took your “.49” as being representative of the first 2 digits following the DOT character “.”. If however you want a replacement ONLY if “.49” is present then the Find regex would be
        (\.49)\d{23}

        So is the number possibly going to be longer than 25 digits after the DOT character, or maybe shorter. These would be regarded as edge cases as currently the supplied solutions may not give you exactly what you want.

        Terry

        1 Reply Last reply Reply Quote 4
        • breakfreerut rutB
          breakfreerut rut
          last edited by

          GREAT! Thanks. The search expression worked.

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