Regex for strong password validation in JavaScript

This pattern uses lookaheads to require at least one lowercase, one uppercase, and one digit across 8+ characters. Test candidate passwords live below.

Working example
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,}$/

Try it live

The pattern and sample strings below are pre-loaded. Edit anything, or describe a variation in plain English and generate your own.

/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,}$/valid ✓

Tested live on the JavaScript engine. Other flavors are validated and flagged for differences, not executed.

No samples.

Related regex recipes