diff --git a/src/jquery.maskMoney.js b/src/jquery.maskMoney.js
index <HASH>..<HASH> 100644
--- a/src/jquery.maskMoney.js
+++ b/src/jquery.maskMoney.js
@@ -167,7 +167,7 @@
                         leadingZeros;
 
                     // remove initial zeros
-                    integerPart = integerPart.replace(/^0/g, "");
+                    integerPart = integerPart.replace(/^0*/g, "");
                     // put settings.thousands every 3 chars
                     integerPart = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, settings.thousands);
                     if (integerPart === "") {
diff --git a/test/mask_test.js b/test/mask_test.js
index <HASH>..<HASH> 100644
--- a/test/mask_test.js
+++ b/test/mask_test.js
@@ -8,6 +8,13 @@ test("simple", function() {
     equal(input.val(), "0.00", "mask method when trigged correctly formatted input value");
 });
 
+test("with a lot of leading zeroes", function() {
+    var input = $("#input1").maskMoney();
+    input.val("000000000123");
+    input.maskMoney("mask");
+    equal(input.val(), "1.23", "removes the unecessary zeroes");
+});
+
 test("with a number as parameter", function() {
     var input = $("#input1").maskMoney();
     input.maskMoney("mask", 123456.78);
fixing the regular expression that removes the leading zeroes