Password Policy Regex Builder
Set code-point length, character groups and optional ASCII punctuation. Test synthetic input and copy or download the anchored ECMAScript regex.
Try a Password Policy on Sample Inputs
Password Policy Regex Builder: how to use it
- Set minimum and maximum lengths and choose Unicode or restricted ASCII.
- Enable the required composition rules. In ASCII mode, list the exact punctuation allowed.
- Build the pattern. Optionally enter an invented test string to check whether it matches, then copy or download the regex.
Limits and notes
Supports 1–512 code points, 48 ASCII punctuation characters and one synthetic test up to 2,048 UTF-16 code units. Produces an ECMAScript regex literal with the u flag. Pattern checks establish syntax only.
How your privacy works →Password Policy Regex Builder: common questions
What does the u flag change?
The repeating character class counts Unicode code points, so many emoji count once. A joined emoji sequence can still contain several code points.
Why use an end assertion instead of a dollar sign?
The negative lookahead (?![\s\S]) checks that no code point remains at the current position. Keep the u flag and use the exported literal without multiline matching.
Does matching this pattern make a password strong?
A match means the string follows the selected length and character rules. Password verifiers must make separate choices about password screening, storage and attempt limits.