Это самый быстрый способ
^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)[a-zA-Z0-9]{8,}$
Если вы заботитесь о производительности, тест показывает, что она будет в два раза быстрее.
Regex1: ^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)[a-zA-Z0-9]{8,}$
Options: < m >
Completed iterations: 50 / 50 ( x 1000 )
Matches found per iteration: 1
Elapsed Time: 0.75 s, 754.66 ms, 754662 µs
Matches per sec: 66,254
Regex2: ^(?=[A-Z0-9]*[a-z])(?=[a-zA-Z]*[0-9])(?=[a-z0-9]*[A-Z])[a-zA-Z0-9]{8,}$
Options: < m >
Completed iterations: 50 / 50 ( x 1000 )
Matches found per iteration: 1
Elapsed Time: 1.32 s, 1321.82 ms, 1321822 µs
Matches per sec: 37,826