function (chrs, buffer, pos, strict, opts) {
                        if (chrs == "") return false;
                        if (!strict && pos <= 1 && buffer[0] === '0' && new RegExp("[\\d-]").test(chrs) && buffer.join('').length == 1) { //handle first char
                            buffer[0] = "";
                            return { "pos": 0 };
                        }

                        var cbuf = strict ? buffer.slice(0, pos) : buffer.slice();

                        cbuf.splice(pos, 0, chrs);
                        var bufferStr = cbuf.join('');

                        //strip groupseparator
                        var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator);
                        bufferStr = bufferStr.replace(new RegExp(escapedGroupSeparator, "g"), '');

                        var isValid = opts.regex.number(opts).test(bufferStr);
                        if (!isValid) {
                            //let's help the regex a bit
                            bufferStr += "0";
                            isValid = opts.regex.number(opts).test(bufferStr);
                            if (!isValid) {
                                //make a valid group
                                var lastGroupSeparator = bufferStr.lastIndexOf(opts.groupSeparator);
                                for (var i = bufferStr.length - lastGroupSeparator; i <= 3; i++) {
                                    bufferStr += "0";
                                }

                                isValid = opts.regex.number(opts).test(bufferStr);
                                if (!isValid && !strict) {
                                    if (chrs == opts.radixPoint) {
                                        isValid = opts.regex.number(opts).test("0" + bufferStr + "0");
                                        if (isValid) {
                                            buffer[pos] = "0";
                                            pos++;
                                            return { "pos": pos };
                                        }
                                    }
                                }
                            }
                        }

                        if (isValid != false && !strict && chrs != opts.radixPoint) {
                            var newPos = opts.postFormat(buffer, pos, false, opts);
                            return { "pos": newPos };
                        }

                        return isValid;
                    }
function (chrs, buffer, pos, strict, opts) {
                        if (chrs == "") return false;
                        if (!strict && pos <= 1 && buffer[0] === '0' && new RegExp("[\\d-]").test(chrs) && buffer.join('').length == 1) { //handle first char
                            buffer[0] = "";
                            return { "pos": 0 };
                        }

                        var cbuf = strict ? buffer.slice(0, pos) : buffer.slice();

                        cbuf.splice(pos, 0, chrs);
                        var bufferStr = cbuf.join('');

                        //strip groupseparator
                        var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator);
                        bufferStr = bufferStr.replace(new RegExp(escapedGroupSeparator, "g"), '');

                        var isValid = opts.regex.number(opts).test(bufferStr);
                        if (!isValid) {
                            //let's help the regex a bit
                            bufferStr += "0";
                            isValid = opts.regex.number(opts).test(bufferStr);
                            if (!isValid) {
                                //make a valid group
                                var lastGroupSeparator = bufferStr.lastIndexOf(opts.groupSeparator);
                                for (var i = bufferStr.length - lastGroupSeparator; i <= 3; i++) {
                                    bufferStr += "0";
                                }

                                isValid = opts.regex.number(opts).test(bufferStr);
                                if (!isValid && !strict) {
                                    if (chrs == opts.radixPoint) {
                                        isValid = opts.regex.number(opts).test("0" + bufferStr + "0");
                                        if (isValid) {
                                            buffer[pos] = "0";
                                            pos++;
                                            return { "pos": pos };
                                        }
                                    }
                                }
                            }
                        }

                        if (isValid != false && !strict && chrs != opts.radixPoint) {
                            var newPos = opts.postFormat(buffer, pos, false, opts);
                            return { "pos": newPos };
                        }

                        return isValid;
                    }
function ( chrs , buffer , pos , strict , opts ) { if ( chrs == "" ) return false ; if ( ! strict && pos <= 1 && buffer [ 0 ] === '0' && new RegExp ( "[\\d-]" ) . test ( chrs ) && buffer . join ( '' ) . length == 1 ) { //handle first char buffer [ 0 ] = "" ; return { "pos" : 0 } ; } var cbuf = strict ? buffer . slice ( 0 , pos ) : buffer . slice ( ) ; cbuf . splice ( pos , 0 , chrs ) ; var bufferStr = cbuf . join ( '' ) ; //strip groupseparator var escapedGroupSeparator = $ . inputmask . escapeRegex . call ( this , opts . groupSeparator ) ; bufferStr = bufferStr . replace ( new RegExp ( escapedGroupSeparator , "g" ) , '' ) ; var isValid = opts . regex . number ( opts ) . test ( bufferStr ) ; if ( ! isValid ) { //let's help the regex a bit bufferStr += "0" ; isValid = opts . regex . number ( opts ) . test ( bufferStr ) ; if ( ! isValid ) { //make a valid group var lastGroupSeparator = bufferStr . lastIndexOf ( opts . groupSeparator ) ; for ( var i = bufferStr . length - lastGroupSeparator ; i <= 3 ; i ++ ) { bufferStr += "0" ; } isValid = opts . regex . number ( opts ) . test ( bufferStr ) ; if ( ! isValid && ! strict ) { if ( chrs == opts . radixPoint ) { isValid = opts . regex . number ( opts ) . test ( "0" + bufferStr + "0" ) ; if ( isValid ) { buffer [ pos ] = "0" ; pos ++ ; return { "pos" : pos } ; } } } } } if ( isValid != false && ! strict && chrs != opts . radixPoint ) { var newPos = opts . postFormat ( buffer , pos , false , opts ) ; return { "pos" : newPos } ; } return isValid ; }
real number
real number
check if a character is valid