Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

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

    Help wanted · · · – – – · · ·
    3
    6
    51
    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
      Bahaa Eddin ツ last edited by Bahaa Eddin ツ

      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”

      Alan Kilborn 1 Reply Last reply Reply Quote 0
      • Alan Kilborn
        Alan Kilborn @Bahaa Eddin ツ last edited by Alan Kilborn

        @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 Reply Quote 1
        • B
          Bahaa Eddin ツ @Alan Kilborn last edited by

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

          Lycan Thrope 1 Reply Last reply Reply Quote 1
          • B
            Bahaa Eddin ツ @Alan Kilborn last edited by

            @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

            Alan Kilborn 1 Reply Last reply Reply Quote 1
            • Alan Kilborn
              Alan Kilborn @Bahaa Eddin ツ last edited by

              @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
              • Lycan Thrope
                Lycan Thrope @Bahaa Eddin ツ last edited by

                @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
                • First post
                  Last post
                Copyright © 2014 NodeBB Forums | Contributors