Community
    • Login

    Regex - What once worked now does not. I think.

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 554 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.
    • S Offline
      Skullmonger
      last edited by

      I’m doing a simple find and replace. I had it working, now it doesn’t work.

      Have I made a mistake? It’s so simple:

      [(A-Z)\.][(A-Z)]

      Or maybe:
      [(A-Z)(\.)][(A-Z)]

      It should find instances of any uppercase alpha character, followed by a “.”, followed by another uppercase alpha character.

      And it worked in the past!

      I do it today and it is ALSO finding any instance of two uppercase alpha characters in a row.

      What have I forgotten here?

      Thanks guys.

      1 Reply Last reply Reply Quote 0
      • S Offline
        Skullmonger
        last edited by

        OK my time to edit a post is gone so I have to correct the above in a new post:

        I do it today and it is finding any instance of two uppercase alpha characters in a row, and any instance of a “.” followed by an uppercase alpha character.

        Instead of finding “A.B” and NOT “AB”, it is finding “AB” and “.B” and NEVER “A.B”.

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          Skullmonger @Skullmonger
          last edited by

          Wait… now if I look at my search history it gives me:
          ([A-Z].)([A-Z])

          I’m an idiot.

          Alan KilbornA 1 Reply Last reply Reply Quote 1
          • Alan KilbornA Offline
            Alan Kilborn @Skullmonger
            last edited by

            @Skullmonger said in Regex - What once worked now does not. I think.:

            I’m an idiot.

            And since you didn’t put your regex inside backticks when posting, so that it looks like this (the formatting): see how I'm in red
            We really don’t have a lot of confidence in what you’ve said in order to be able to help you (if you still need help, which is unclear).

            1 Reply Last reply Reply Quote 1
            • Thomas 2020T Offline
              Thomas 2020
              last edited by Thomas 2020

              Maybe that’s it?
              [A-Z]\.[A-Z]

              1 Reply Last reply Reply Quote 0

              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