JSFiddle - React, Tailwind, and code Playground
JavaScript
if(type === 'password') { expresion = /^(?=.*[a-z0-9])(?=.*[A-Z0-9])(?=.*\d)(?=.*[!$*-.=?@_+])([A-Za-z0-9\d!$*-.=?@_+]|[^ ]){8,30}$/; }
if(type === 'password') { expresion = /^(?=.*[a-z0-9])(?=.*[A-Z0-9])(?=.*\d)(?=.*[!$*-.=?@_+])([A-Za-z0-9\d!$*-.=?@_+]|[^ ]){8,30}$/; }