• Login
Community
  • Login

Delete numbers following letters ( i.e. \w\d+\s becomes \w\s)

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 2 Posters 307 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.
  • L
    Luís Gonçalves
    last edited by Mar 23, 2023, 2:17 PM

    Hello everyone.

    I’m having a hard time trying to delete the numbers that follow letters in a text I’m working on. Let me explain:

    I basically converted a PDF to TXT, but in so doing, some words got some numbers attached to them (ex: “mindful2” or “ready27”) because those were references to notes to the text in the original PDF.

    Is there a way to delete only the numbers that immediately follow letters (something like \w\d+\s )?

    Thanks in advance!

    A 1 Reply Last reply Mar 23, 2023, 2:30 PM Reply Quote 0
    • A
      Alan Kilborn @Luís Gonçalves
      last edited by Alan Kilborn Mar 23, 2023, 2:31 PM Mar 23, 2023, 2:30 PM

      @Luís-Gonçalves

      …only the numbers that immediately follow letters

      To provide what you’ve asked for:

      Find: (?i)(?<=[a-z])\d+
      Search mode: Regular expression

      (Hmm, after the fact I notice that you are a repeat regexer – but you did provide a “what I tried”, so…)

      L 1 Reply Last reply Mar 23, 2023, 4:18 PM Reply Quote 2
      • L
        Luís Gonçalves @Alan Kilborn
        last edited by Mar 23, 2023, 4:18 PM

        @Alan-Kilborn you’re right! Haha. Sorry about that, I’m just finding how regular expressions work (and I’m loving it, even though it’s hard to learn all by oneself)… so I’m sorry if sometimes my questions are more or less repetitive -.-’

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