Regex validation error in ‘formvalidation.io’ [duplicate]

I’ve post this question also on the github channel of the library but it looks no one answer question’s there.
So I try to find an answer here.

I’m trying to validate a password with a RegEx, and a second password field to verify that it’s the same as the first.
The Regex works correctly until a first succesfull check, then start to return a failure regex validation every 2 form validation.

This is the formvalidation options:

       var fl = FormValidation.formValidation(frmp, {
        fields: {
            'password': {
                validators: {
                    notEmpty: {
                        message: "Field Required"
                    },
                    regexp: {
                        regexp: /^(?=.*d)(?=.*[a-z])(?=.*[A-Z])(?=.*[_.,-+*!#@?])([a-zA-Z0-9_.,-+*!#@?]{8,25})$/g,
                        message: "Password should be between 8 and 25 char, 1 uppercase, 1 number and 1 _.,-+*!#@"
                    }
                },
            },
            'rpassword': {
                validators: {
                    notEmpty: {
                        message: "Field Required"
                    },
                    identical: {
                        compare: function () {
                            return frmp.querySelector('[name="password"]').value;
                        },
                        message: "Passwords don't match"
                    }
                },
            },
        },
        plugins: {
            trigger: new FormValidation.plugins.Trigger,
            bootstrap: new FormValidation.plugins.Bootstrap5(),
            excluded: new FormValidation.plugins.Excluded
        }
    })

Please take a look at this example on Codepen:

Codepen Example

Fill in the first field with a password that respects the RegEx rule and validate the field, then contiinue typing in the field to start the form validation. The RegEx rule generates the error alternately, once yes and once no, even if the field contains a password that respects the RegEx rule