RegEx for maximum length in JavaScript December 21, 2023 by Tarik You are missing closing dollar at the end. Correct one is: /^.{6,7}$/