6 Replies Latest reply on Jul 12, 2010 1:58 PM by Adam Cameron.

    RegEx Help Needed

    WestSide Level 1

      Hi,


      I'm awful with regular expressions most likely because I haven't spent much time writing them but I'd like to have one that does the following

       

      Requirements

       

      1. Must be a minimum of 7 characters

       

      2. Must have at least 3 out 4 of the following

          2a) 1 Uppercase letter

         2b) 1 Lowercase letter

         2c) 1 Number

         2d) 1 Symbol

       

      So I want to pass in a string, and then run it against a regex that does the above.


      Any help appreciated

       

      -ws

        • 1. Re: RegEx Help Needed
          Adam Cameron. Level 5

          Did you google for "password validation regex" or something like that, to see how people have resolved this issue in the past?

           

          --

          Adam

          • 3. Re: RegEx Help Needed
            WestSide Level 1

            Hi,


            @Adam - I did Google, but not enough.

             

            The link turned out to be exactly what I was looking for.

             

            Thanks again...

            • 4. Re: RegEx Help Needed
              Adam Cameron. Level 5

              Cool, glad you got it sorted.  Sorry for the oblique response, but I reckon it's more handy to help guide people in the right direction to find the answer for themselves than to just blurt it out.

               

              --

              Adam

              • 5. Re: RegEx Help Needed
                WestSide Level 1

                Typically, providing guidance does work as you've suggested, and blurting something isn't that helpful I guess, but I think there is a medium between pointing someone to Google and blurting out the solution.

                 

                Everyone knows about Google, saying go to Google doesn't add much value to be honest.  Nor does spelling the answer out to a given problem, but there's definitely a middle ground and I guess that's what I was looking for.


                Either way, you've assisted me before so I can't complain.

                 

                Thanks again... your one of the few folks that are active here...

                 

                -ws

                • 6. Re: RegEx Help Needed
                  Adam Cameron. Level 5

                  You would be surprised at the number of people that it never occurs to to investigate something themselves before trying to get someone else to be their brains for them.  I'm not saying this was the case with you, but then again you didn't give any evidence to suggest you had done any of your own investigation either, so I asked if you had.  And, what's more, I gave you a google search string that gives you the answer in the first search result, ie: I didn't just say "have you googled it?" I said "have you googled [THIS]", knowing it would give you the answer if you searched on that string.  It wasn't a random suggestion.

                   

                  So maybe not as unhelpful or obtuse as you might think?

                   

                  Anyway, whatever.  No worries.

                   

                  --

                  Adam