Server IP : 108.163.255.210 / Your IP : 3.21.105.46 Web Server : Apache System : Linux blossom.urlnameserver.com 3.10.0-1160.80.1.el7.x86_64 #1 SMP Tue Nov 8 15:48:59 UTC 2022 x86_64 User : ( 1172) PHP Version : 7.2.34 Disable Function : eval,escapeshellarg,proc_close,proc_get_status,proc_nice,proc_open,symlink,system,pcntl_exec,getrusage,chown,chgp,closelog,openlog,syslog,define_syslog_variables,php_ini_loaded_file,getservbyname,getservbyport,posix_getgid,posix_getgrgid,proc_terminate,pfsockopen,apache_child_terminate,posix_mkfifo,posix_setpgid,posix_setuid,hypot,pg_host,pos,posix_access,posix_getcwd,posix_getservbyname,myshellexec,getpid,posix_getsid,posix_isatty,posix_kill,posix_mknod,posix_setgid,posix_setsid,posix_setuid,posix_times,posix_uname,ps_fill,posix_getpwuid,global,ini_restore,zip_open,zip_read,rar_open,bzopen,bzread,bzwrite,apache_get_modules,apache_get_version,phpversionphpinfo,php_ini_scanned_files,get_current_user,disk_total_space,diskfreespace,leak,imap_list,hypo,filedump,safe_mode,getmygid,apache_getenv,apache_setenv,bzread,bzwrite,bzopen,phpini,higlight_file,dos_conv,get_cwd,er_log,cmd,e_name,vdir,get_dir,only_read,ftok,ftpexec,posix_getpwnam,mysql_list_dbs,disk_free_space,session_save_path,confirm_phpdoc_compiled,zip_entry_rea,php_u,psockopen,crack_opendict,crack_getlastmessage,crack_closedict,crack_check,fpassthru,posix_get_last_error,posix_getlogin,posix_getgroups,posix_strerror,posix_getrlimit,posix_getpgrp,posix_getgrnam,pos,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/unilinki/public_html/payroll/admin/plugins/input-mask/ |
Upload File : |
/* Input Mask plugin extensions http://github.com/RobinHerbots/jquery.inputmask Copyright (c) 2010 - 2014 Robin Herbots Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php) Version: 0.0.0 Regex extensions on the jquery.inputmask base Allows for using regular expressions as a mask */ (function ($) { $.extend($.inputmask.defaults.aliases, { // $(selector).inputmask("Regex", { regex: "[0-9]*"} 'Regex': { mask: "r", greedy: false, repeat: "*", regex: null, regexTokens: null, //Thx to https://github.com/slevithan/regex-colorizer for the tokenizer regex tokenizer: /\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g, quantifierFilter: /[0-9]+[^,]/, definitions: { 'r': { validator: function (chrs, buffer, pos, strict, opts) { function regexToken() { this.matches = []; this.isGroup = false; this.isQuantifier = false; this.isLiteral = false; } function analyseRegex() { var currentToken = new regexToken(), match, m, opengroups = []; opts.regexTokens = []; // The tokenizer regex does most of the tokenization grunt work while (match = opts.tokenizer.exec(opts.regex)) { m = match[0]; switch (m.charAt(0)) { case "[": // Character class case "\\": // Escape or backreference if (opengroups.length > 0) { opengroups[opengroups.length - 1]["matches"].push(m); } else { currentToken.matches.push(m); } break; case "(": // Group opening if (!currentToken.isGroup && currentToken.matches.length > 0) opts.regexTokens.push(currentToken); currentToken = new regexToken(); currentToken.isGroup = true; opengroups.push(currentToken); break; case ")": // Group closing var groupToken = opengroups.pop(); if (opengroups.length > 0) { opengroups[opengroups.length - 1]["matches"].push(groupToken); } else { opts.regexTokens.push(groupToken); currentToken = new regexToken(); } break; case "{": //Quantifier var quantifier = new regexToken(); quantifier.isQuantifier = true; quantifier.matches.push(m); if (opengroups.length > 0) { opengroups[opengroups.length - 1]["matches"].push(quantifier); } else { currentToken.matches.push(quantifier); } break; default: // Vertical bar (alternator) // ^ or $ anchor // Dot (.) // Literal character sequence var literal = new regexToken(); literal.isLiteral = true; literal.matches.push(m); if (opengroups.length > 0) { opengroups[opengroups.length - 1]["matches"].push(literal); } else { currentToken.matches.push(literal); } } } if (currentToken.matches.length > 0) opts.regexTokens.push(currentToken); } function validateRegexToken(token, fromGroup) { var isvalid = false; if (fromGroup) { regexPart += "("; openGroupCount++; } for (var mndx = 0; mndx < token["matches"].length; mndx++) { var matchToken = token["matches"][mndx]; if (matchToken["isGroup"] == true) { isvalid = validateRegexToken(matchToken, true); } else if (matchToken["isQuantifier"] == true) { matchToken = matchToken["matches"][0]; var quantifierMax = opts.quantifierFilter.exec(matchToken)[0].replace("}", ""); var testExp = regexPart + "{1," + quantifierMax + "}"; //relax quantifier validation for (var j = 0; j < openGroupCount; j++) { testExp += ")"; } var exp = new RegExp("^(" + testExp + ")$"); isvalid = exp.test(bufferStr); regexPart += matchToken; } else if (matchToken["isLiteral"] == true) { matchToken = matchToken["matches"][0]; var testExp = regexPart, openGroupCloser = ""; for (var j = 0; j < openGroupCount; j++) { openGroupCloser += ")"; } for (var k = 0; k < matchToken.length; k++) { //relax literal validation testExp = (testExp + matchToken[k]).replace(/\|$/, ""); var exp = new RegExp("^(" + testExp + openGroupCloser + ")$"); isvalid = exp.test(bufferStr); if (isvalid) break; } regexPart += matchToken; //console.log(bufferStr + " " + exp + " " + isvalid); } else { regexPart += matchToken; var testExp = regexPart.replace(/\|$/, ""); for (var j = 0; j < openGroupCount; j++) { testExp += ")"; } var exp = new RegExp("^(" + testExp + ")$"); isvalid = exp.test(bufferStr); //console.log(bufferStr + " " + exp + " " + isvalid); } if (isvalid) break; } if (fromGroup) { regexPart += ")"; openGroupCount--; } return isvalid; } if (opts.regexTokens == null) { analyseRegex(); } var cbuffer = buffer.slice(), regexPart = "", isValid = false, openGroupCount = 0; cbuffer.splice(pos, 0, chrs); var bufferStr = cbuffer.join(''); for (var i = 0; i < opts.regexTokens.length; i++) { var regexToken = opts.regexTokens[i]; isValid = validateRegexToken(regexToken, regexToken["isGroup"]); if (isValid) break; } return isValid; }, cardinality: 1 } } } }); })(jQuery);