• Login
Community
  • Login

Why [A-Z] = [a-z]?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
6 Posts 3 Posters 322 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.
  • B
    Bahaa0013
    last edited by Bahaa0013 Feb 28, 2023, 7:57 PM Feb 28, 2023, 7:55 PM

    I’m trying to replace uppercase characters with “?u”
    Lowercase with “?l”, And Numbers with “?d”…
    But there is a problem, When I try to replace [A-Z] characters it detect everything as uppercase and replace all of the charecters as"?u", and when I search [a-z] it also detect every character as lowercase and replace them as “?l”

    example:

    N4eHbZ+HsytYV+dzi3y7UAv3YRqAd5oPJzXnL6QK2d3EvkVu2N1R+BeniJmkY0Z0GGySmDeoVSTxZ7xfJEG5OMDSYEXsOKTOsKT
    

    output for “([A-Z]) & and replace with “?u””

    ?u4?u?u?u?u+?u?u?u?u?u?u+?u?u?u3?u7?u?u?u3?u?u?u?u?u5?u?u?u?u?u?u?u6?u?u2?u3?u?u?u?u?u2?u1?u+?u?u?u?u?u?u?u?u0?u0?u?u?u?u?u?u?u?u?u?u?u?u?u7?u?u?u?u?u5?u?u?u?u?u?u?u?u?u?u?u?u?u?u?u
    

    aslo the same output for lowecase ([a-z]):

    ?l4?l?l?l?l+?l?l?l?l?l?l+?l?l?l3?l7?l?l?l3?l?l?l?l?l5?l?l?l?l?l?l?l6?l?l2?l3?l?l?l?l?l2?l1?l+?l?l?l?l?l?l?l?l0?l0?l?l?l?l?l?l?l?l?l?l?l?l?l7?l?l?l?l?l5?l?l?l?l?l?l?l?l?l?l?l?l?l?l?l
    

    So I want to replace uppercase with “?u”, lowercase with “?l” and numbers with “?d” in the previous example.

    the expected output should looks like this:
    “?u?d?l?u?l?u+?u?l?l?l?u?u+?l?l …etc”

    A 1 Reply Last reply Feb 28, 2023, 7:57 PM Reply Quote 0
    • A
      Alan Kilborn @Bahaa0013
      last edited by Alan Kilborn Feb 28, 2023, 7:59 PM Feb 28, 2023, 7:57 PM

      @Bahaa-Eddin-ツ

      When I try to replace [A-Z] characters it detect everything as uppercase

      First problem:
      Match-case checkbox?

      replace with “?u””

      Second problem:
      ?u is not a valid replace expression.
      Have you RTFM?

      B 2 Replies Last reply Feb 28, 2023, 7:59 PM Reply Quote 1
      • B
        Bahaa0013 @Alan Kilborn
        last edited by Feb 28, 2023, 7:59 PM

        @Alan-Kilborn
        yes you are right thanks it work now… I will feel stupid for about 2 months after this 💀

        L 1 Reply Last reply Feb 28, 2023, 8:59 PM Reply Quote 1
        • B
          Bahaa0013 @Alan Kilborn
          last edited by Feb 28, 2023, 8:06 PM

          @Alan-Kilborn
          No, I’m just copying token string of my site, just testing the security level…
          Some sites has 1 type of strings that accepted in their system… So if a hacker know how string looks like, He can generate more strings and brute force the website… So this is a danger, I’m fixing it… That’s it

          A 1 Reply Last reply Feb 28, 2023, 8:07 PM Reply Quote 1
          • A
            Alan Kilborn @Bahaa0013
            last edited by Feb 28, 2023, 8:07 PM

            @Bahaa-Eddin-ツ

            Oh, I see. You just want to replace with a literal ?u. Most questions of this ilk have the poster wanting to convert the case of the matched text.

            1 Reply Last reply Reply Quote 1
            • L
              Lycan Thrope @Bahaa0013
              last edited by Feb 28, 2023, 8:59 PM

              @Bahaa-Eddin-ツ ,
              Nah. You’ll hardly even remember it once it sinks to the bottom of the new posting queue. :)

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