function handlePassword() { const passwordRegexRules = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[a-zA-Z])(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/ const isPasswordValid = passwordRegexRules.test(password) if (!isPasswordValid) Alert.alert('Invalid password. Password must contain at least one uppercase letter, one digit, one special character and be 8 charachters long') } <TextInput textContentType="password" secureTextEntry value={ password } onChangeText={ setPassword } onBlur={ handlePassword } > Senha </TextInput>