浏览代码

fix some alternation regression

Robin Herbots 9 年之前
父节点
当前提交
24d9851c34
共有 46 个文件被更改,包括 79 次插入76 次删除
  1. 3 0
      CHANGELOG.md
  2. 5 2
      README.md
  3. 1 1
      bower.json
  4. 1 1
      component.json
  5. 1 1
      composer.json
  6. 1 1
      dist/inputmask/bindings/inputmask.binding.js
  7. 1 1
      dist/inputmask/dependencyLibs/inputmask.dependencyLib.jqlite.js
  8. 1 1
      dist/inputmask/dependencyLibs/inputmask.dependencyLib.jquery.js
  9. 1 1
      dist/inputmask/dependencyLibs/inputmask.dependencyLib.js
  10. 1 1
      dist/inputmask/global/document.js
  11. 1 1
      dist/inputmask/global/window.js
  12. 1 1
      dist/inputmask/inputmask.date.extensions.js
  13. 1 1
      dist/inputmask/inputmask.extensions.js
  14. 8 5
      dist/inputmask/inputmask.js
  15. 1 1
      dist/inputmask/inputmask.numeric.extensions.js
  16. 1 1
      dist/inputmask/inputmask.phone.extensions.js
  17. 1 1
      dist/inputmask/inputmask.regex.extensions.js
  18. 1 1
      dist/inputmask/jquery.inputmask.js
  19. 1 1
      dist/inputmask/phone-codes/phone-be.js
  20. 1 1
      dist/inputmask/phone-codes/phone-nl.js
  21. 1 1
      dist/inputmask/phone-codes/phone-ru.js
  22. 1 1
      dist/inputmask/phone-codes/phone-uk.js
  23. 1 1
      dist/inputmask/phone-codes/phone.js
  24. 8 5
      dist/jquery.inputmask.bundle.js
  25. 1 1
      dist/min/inputmask/bindings/inputmask.binding.min.js
  26. 1 1
      dist/min/inputmask/dependencyLibs/inputmask.dependencyLib.jqlite.min.js
  27. 1 1
      dist/min/inputmask/dependencyLibs/inputmask.dependencyLib.jquery.min.js
  28. 1 1
      dist/min/inputmask/dependencyLibs/inputmask.dependencyLib.min.js
  29. 1 1
      dist/min/inputmask/global/document.min.js
  30. 1 1
      dist/min/inputmask/global/window.min.js
  31. 1 1
      dist/min/inputmask/inputmask.date.extensions.min.js
  32. 1 1
      dist/min/inputmask/inputmask.extensions.min.js
  33. 3 3
      dist/min/inputmask/inputmask.min.js
  34. 1 1
      dist/min/inputmask/inputmask.numeric.extensions.min.js
  35. 1 1
      dist/min/inputmask/inputmask.phone.extensions.min.js
  36. 1 1
      dist/min/inputmask/inputmask.regex.extensions.min.js
  37. 1 1
      dist/min/inputmask/jquery.inputmask.min.js
  38. 1 1
      dist/min/inputmask/phone-codes/phone-be.min.js
  39. 1 1
      dist/min/inputmask/phone-codes/phone-nl.min.js
  40. 1 1
      dist/min/inputmask/phone-codes/phone-ru.min.js
  41. 1 1
      dist/min/inputmask/phone-codes/phone-uk.min.js
  42. 1 1
      dist/min/inputmask/phone-codes/phone.min.js
  43. 4 4
      dist/min/jquery.inputmask.bundle.min.js
  44. 4 2
      js/inputmask.js
  45. 1 1
      package.json
  46. 6 17
      qunit/tests_alternations.js

+ 3 - 0
CHANGELOG.md

@@ -2,6 +2,9 @@
 All notable changes to this project will be documented in this file.
 
 ## [UNRELEASED]
+### Updates
+- alternator syntax update - regex like alternations is now supported (aa|99|AA) ~ aa or 99 or AA
+
 ### Fixed
 - Regex with placeholder, not working? #798
 - Visualize regular expressions #1040

+ 5 - 2
README.md

@@ -276,9 +276,12 @@ $(document).ready(function(){
 ```
 
 ### Alternator masks
-The alternator syntax is like an **OR** statement.  The mask can be one of the 2 choices specified in the alternator.
+The alternator syntax is like an **OR** statement.  The mask can be one of the 3 choices specified in the alternator.
 
-To define an alternator use the |.<br>ex: "a|9" => a or 9<br>    "(aaa)|(999)" => aaa or 999
+To define an alternator use the |.  
+ex: "a|9" => a or 9  
+"(aaa)|(999)" => aaa or 999  
+"(aaa|999|9AA)" => aaa or 999 or 9AA
 
 Also make sure to read about the keepStatic option.
 

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "inputmask",
-  "version": "3.3.6-4",
+  "version": "3.3.6-10",
   "main": [
 	  "./dist/inputmask/inputmask.js",
 	  "./dist/inputmask/inputmask.extensions.js",

+ 1 - 1
component.json

@@ -2,7 +2,7 @@
 	"name": "inputmask",
 	"repository": "robinherbots/Inputmask",
 	"description": "Inputmask is a javascript library which creates an input mask.  Inputmask can run against vanilla javascript, jQuery and jqlite.",
-	"version": "3.3.6-4",
+	"version": "3.3.6-10",
 	"keywords": [
 		"jquery",
 		"plugins",

+ 1 - 1
composer.json

@@ -1,7 +1,7 @@
 {
   "name": "robinherbots/inputmask",
   "description": "Inputmask is a javascript library which creates an input mask.  Inputmask can run against vanilla javascript, jQuery and jqlite.",
-  "version": "3.3.6-4",
+  "version": "3.3.6-10",
   "type": "library",
   "keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
   "homepage": "http://robinherbots.github.io/Inputmask",

+ 1 - 1
dist/inputmask/bindings/inputmask.binding.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/dependencyLibs/inputmask.dependencyLib.jqlite.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/dependencyLibs/inputmask.dependencyLib.jquery.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/dependencyLibs/inputmask.dependencyLib.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/global/document.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 "function" == typeof define && define.amd ? define(function() {

+ 1 - 1
dist/inputmask/global/window.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 "function" == typeof define && define.amd ? define(function() {

+ 1 - 1
dist/inputmask/inputmask.date.extensions.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/inputmask.extensions.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 !function(factory) {

+ 8 - 5
dist/inputmask/inputmask.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 !function(factory) {
@@ -398,7 +398,7 @@
             if ($.isFunction(opts.preValidation) && !strict && !0 !== fromSetValid && (result = opts.preValidation(getBuffer(), maskPos, c, isSelection(pos), opts)), 
             !0 === result) {
                 if (fillMissingNonMask(maskPos), isSelection(pos) && (handleRemove(undefined, Inputmask.keyCode.DELETE, pos), 
-                maskPos = getMaskSet().p), maskPos < getMaskSet().maskLength && (result = _isValid(maskPos, c, strict), 
+                maskPos = getMaskSet().p), maskPos < getMaskSet().maskLength && (maxLength === undefined || maskPos < maxLength) && (result = _isValid(maskPos, c, strict), 
                 (!strict || !0 === fromSetValid) && !1 === result)) {
                     var currentPosValid = getMaskSet().validPositions[maskPos];
                     if (!currentPosValid || null !== currentPosValid.match.fn || currentPosValid.match.def !== c && c !== opts.skipOptionalPartCharacter) {
@@ -1543,9 +1543,12 @@
                     break;
 
                   case opts.alternatormarker:
-                    if (openenings.length > 0 ? (currentOpeningToken = openenings[openenings.length - 1], 
-                    lastMatch = currentOpeningToken.openGroup ? openenings.pop() : currentOpeningToken.matches.pop()) : lastMatch = currentToken.matches.pop(), 
-                    lastMatch.isAlternator) openenings.push(lastMatch); else if (lastMatch.alternatorGroup ? (alternator = openenings.pop(), 
+                    if (openenings.length > 0) {
+                        currentOpeningToken = openenings[openenings.length - 1];
+                        var subToken = currentOpeningToken.matches[currentOpeningToken.matches.length - 1];
+                        lastMatch = currentOpeningToken.openGroup && (subToken.matches === undefined || !1 === subToken.isGroup && !1 === subToken.isAlternator) ? openenings.pop() : currentOpeningToken.matches.pop();
+                    } else lastMatch = currentToken.matches.pop();
+                    if (lastMatch.isAlternator) openenings.push(lastMatch); else if (lastMatch.alternatorGroup ? (alternator = openenings.pop(), 
                     lastMatch.alternatorGroup = !1) : alternator = new MaskToken(!1, !1, !1, !0), alternator.matches.push(lastMatch), 
                     openenings.push(alternator), lastMatch.openGroup) {
                         lastMatch.openGroup = !1;

+ 1 - 1
dist/inputmask/inputmask.numeric.extensions.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/inputmask.phone.extensions.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/inputmask.regex.extensions.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/jquery.inputmask.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/phone-codes/phone-be.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/phone-codes/phone-nl.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/phone-codes/phone-ru.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/phone-codes/phone-uk.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/phone-codes/phone.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 !function(factory) {

+ 8 - 5
dist/jquery.inputmask.bundle.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 !function(factory) {
@@ -397,7 +397,7 @@
                 if ($.isFunction(opts.preValidation) && !strict && !0 !== fromSetValid && (result = opts.preValidation(getBuffer(), maskPos, c, isSelection(pos), opts)), 
                 !0 === result) {
                     if (fillMissingNonMask(maskPos), isSelection(pos) && (handleRemove(undefined, Inputmask.keyCode.DELETE, pos), 
-                    maskPos = getMaskSet().p), maskPos < getMaskSet().maskLength && (result = _isValid(maskPos, c, strict), 
+                    maskPos = getMaskSet().p), maskPos < getMaskSet().maskLength && (maxLength === undefined || maskPos < maxLength) && (result = _isValid(maskPos, c, strict), 
                     (!strict || !0 === fromSetValid) && !1 === result)) {
                         var currentPosValid = getMaskSet().validPositions[maskPos];
                         if (!currentPosValid || null !== currentPosValid.match.fn || currentPosValid.match.def !== c && c !== opts.skipOptionalPartCharacter) {
@@ -1542,9 +1542,12 @@
                         break;
 
                       case opts.alternatormarker:
-                        if (openenings.length > 0 ? (currentOpeningToken = openenings[openenings.length - 1], 
-                        lastMatch = currentOpeningToken.openGroup ? openenings.pop() : currentOpeningToken.matches.pop()) : lastMatch = currentToken.matches.pop(), 
-                        lastMatch.isAlternator) openenings.push(lastMatch); else if (lastMatch.alternatorGroup ? (alternator = openenings.pop(), 
+                        if (openenings.length > 0) {
+                            currentOpeningToken = openenings[openenings.length - 1];
+                            var subToken = currentOpeningToken.matches[currentOpeningToken.matches.length - 1];
+                            lastMatch = currentOpeningToken.openGroup && (subToken.matches === undefined || !1 === subToken.isGroup && !1 === subToken.isAlternator) ? openenings.pop() : currentOpeningToken.matches.pop();
+                        } else lastMatch = currentToken.matches.pop();
+                        if (lastMatch.isAlternator) openenings.push(lastMatch); else if (lastMatch.alternatorGroup ? (alternator = openenings.pop(), 
                         lastMatch.alternatorGroup = !1) : alternator = new MaskToken(!1, !1, !1, !0), alternator.matches.push(lastMatch), 
                         openenings.push(alternator), lastMatch.openGroup) {
                             lastMatch.openGroup = !1;

文件差异内容过多而无法显示
+ 1 - 1
dist/min/inputmask/bindings/inputmask.binding.min.js


文件差异内容过多而无法显示
+ 1 - 1
dist/min/inputmask/dependencyLibs/inputmask.dependencyLib.jqlite.min.js


+ 1 - 1
dist/min/inputmask/dependencyLibs/inputmask.dependencyLib.jquery.min.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):window.dependencyLib=a(jQuery)}(function(a){return a});

文件差异内容过多而无法显示
+ 1 - 1
dist/min/inputmask/dependencyLibs/inputmask.dependencyLib.min.js


+ 1 - 1
dist/min/inputmask/global/document.min.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 "function"==typeof define&&define.amd?define(function(){return document}):"object"==typeof exports&&(module.exports=document);

+ 1 - 1
dist/min/inputmask/global/window.min.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.6-4
+* Version: 3.3.6-10
 */
 
 "function"==typeof define&&define.amd?define(function(){return window}):"object"==typeof exports&&(module.exports=window);

文件差异内容过多而无法显示
+ 1 - 1
dist/min/inputmask/inputmask.date.extensions.min.js


文件差异内容过多而无法显示
+ 1 - 1
dist/min/inputmask/inputmask.extensions.min.js


文件差异内容过多而无法显示
+ 3 - 3
dist/min/inputmask/inputmask.min.js


文件差异内容过多而无法显示
+ 1 - 1
dist/min/inputmask/inputmask.numeric.extensions.min.js


文件差异内容过多而无法显示
+ 1 - 1
dist/min/inputmask/inputmask.phone.extensions.min.js


文件差异内容过多而无法显示
+ 1 - 1
dist/min/inputmask/inputmask.regex.extensions.min.js


文件差异内容过多而无法显示
+ 1 - 1
dist/min/inputmask/jquery.inputmask.min.js


文件差异内容过多而无法显示
+ 1 - 1
dist/min/inputmask/phone-codes/phone-be.min.js


文件差异内容过多而无法显示
+ 1 - 1
dist/min/inputmask/phone-codes/phone-nl.min.js


文件差异内容过多而无法显示
+ 1 - 1
dist/min/inputmask/phone-codes/phone-ru.min.js


文件差异内容过多而无法显示
+ 1 - 1
dist/min/inputmask/phone-codes/phone-uk.min.js


文件差异内容过多而无法显示
+ 1 - 1
dist/min/inputmask/phone-codes/phone.min.js


文件差异内容过多而无法显示
+ 4 - 4
dist/min/jquery.inputmask.bundle.min.js


+ 4 - 2
js/inputmask.js

@@ -573,7 +573,9 @@
 					case opts.alternatormarker:
 						if (openenings.length > 0) {
 							currentOpeningToken = openenings[openenings.length - 1];
-							if (currentOpeningToken.openGroup) { //regexp alt syntax
+							var subToken = currentOpeningToken.matches[currentOpeningToken.matches.length - 1];
+							if (currentOpeningToken.openGroup && //regexp alt syntax
+								(subToken.matches === undefined || (subToken.isGroup === false && subToken.isAlternator === false))) { //alternations within group
 								lastMatch = openenings.pop();
 							} else
 								lastMatch = currentOpeningToken.matches.pop();
@@ -1706,7 +1708,7 @@
 					maskPos = getMaskSet().p;
 				}
 
-				if (maskPos < getMaskSet().maskLength) {
+				if (maskPos < getMaskSet().maskLength && (maxLength === undefined || maskPos < maxLength)) {
 					result = _isValid(maskPos, c, strict);
 					if ((!strict || fromSetValid === true) && result === false) {
 						var currentPosValid = getMaskSet().validPositions[maskPos];

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "inputmask",
-  "version": "3.3.6-4",
+  "version": "3.3.6-10",
   "description": "Inputmask is a javascript library which creates an input mask.  Inputmask can run against vanilla javascript, jQuery and jqlite.",
   "main": "index.js",
   "files": [

+ 6 - 17
qunit/tests_alternations.js

@@ -121,28 +121,16 @@ define([
 		assert.equal(testmask.inputmask._valueGet(), "WZ", "Result " + testmask.inputmask._valueGet());
 	});
 
-	qunit.test("alternations (9{1,3})|(S|NE|W)-9{1,3}", function (assert) {
+	qunit.test("alternations (9{1,3}|SE|NE|SW|NW)-9{1,3} - yesman85", function (assert) {
 		var $fixture = $("#qunit-fixture");
 		$fixture.append('<input type="text" id="testmask" />');
 		var testmask = document.getElementById("testmask");
 
-		Inputmask("(9{1,3})|(S|NE|W)-9{1,3}").mask(testmask);
-
-		$("#testmask").Type("NE123");
-
-		assert.equal(testmask.inputmask._valueGet(), "NE-123", "Result " + testmask.inputmask._valueGet());
-	});
-
-	qunit.test("alternations (9{1,3})|((S|N)(E|W))-9{1,3} - yesman85", function (assert) {
-		var $fixture = $("#qunit-fixture");
-		$fixture.append('<input type="text" id="testmask" />');
-		var testmask = document.getElementById("testmask");
-
-		Inputmask("(9{1,3})|((S|N)(E|W))-9{1,3}").mask(testmask);
+		Inputmask("(9{1,3}|SE|NE|SW|NW)-9{1,3}").mask(testmask);
 
 		$("#testmask").Type("(NE123");
 
-		assert.equal(testmask.inputmask._valueGet(), "(N)(E)-123", "Result " + testmask.inputmask._valueGet());
+		assert.equal(testmask.inputmask._valueGet(), "NE-123", "Result " + testmask.inputmask._valueGet());
 	});
 
 	qunit.test("((S))", function (assert) {
@@ -305,12 +293,13 @@ define([
 		$("#testmask").Type("23");
 		assert.equal(testmask.inputmask._valueGet(), "23", "Result " + testmask.inputmask._valueGet());
 	});
-	qunit.test("(9)|(09)|(19)|(2f) - type 24 - ivaninDarpatov", function (assert) {
+
+	qunit.test("(9|09|19|2f) - type 24 - ivaninDarpatov", function (assert) {
 		var $fixture = $("#qunit-fixture");
 		$fixture.append('<input type="text" id="testmask" />');
 		var testmask = document.getElementById("testmask");
 
-		Inputmask("(9)|(09)|(19)|(2f)", {
+		Inputmask("(9|09|19|2f)", {
 			definitions: {
 				"f": {validator: "[0-3]"}
 			}