I need a regex which will satisfy both conditions.

It should give me true only when a String contains both A-Z and 0-9.

Here's what I've tried:

> 
> `if PNo[0].matches("^[A-Z0-9]+$")` 
> 
> 
> 

It does not work.