Length-Limit Regex Generator

Builds a regex that limits length from a minimum, a maximum and a character class, and tests strings against it.

Generated pattern:

The pattern is validated with JavaScript's new RegExp using the u flag. What . and \w match varies by language and flags. See the article for porting the pattern elsewhere.

Related article