Regex match string with at least one uppercase and at least one number from 0-9

I am having a problem with the regex expressions. I am trying to match a string, which should contain at least one uppercase charracter and at least one number from 0-9 Lets say we have these strings:

   sdsFg3n match
   asdfghf not match
   aewag3t not match

The order of the charracters and numbers is not important.. The string should just contain them. The expression I tried is [A-Za-z0-9], but that doesn't help me...

Upvotes: 0

Views: 136

Answers (1)

user3458
user3458

Reputation:

How about something simple, like this?

([A-Z].*[0-9])|([0-9].*[A-Z])

Upvotes: 1

Related Questions