Javascript regExp to accept 12 digits before decimal and two digits after decimal
<p>Can anyone tell me the javascript regEx to accept 12 numbers before decimal and to allow only 2 digits after decimal.In case the number does not have any decimal, the text box should accept max of 12 numbers.The value should be only numbers.
I already have a directive where i am performing all the javascript validations.Please let me know what else should be added.</p>

<p>The directive-</p>

<pre><code>.directive('allowOnlyDigits', function () {
    return {
        require: '?ngModel',
        scope: { currencycode: '=' },
        link: function(scope, element, attrs, ngModelCtrl) {
          if(!ngModelCtrl) {
            return; 
          }

          ngModelCtrl.$parsers.push(function(val) {
            if (angular.isUndefined(val)) {
                var val = '';
            }


            var decimalCheck = clean.split('.');

            if(!angular.isUndefined(decimalCheck[1])) {
                decimalCheck[1] = decimalCheck[1].slice(0,2);
                clean = decimalCheck[0] + '.' + decimalCheck[1];
            }

            if (val !== clean) {
              ngModelCtrl.$setViewValue(clean);
              ngModelCtrl.$render();
            }
            return clean;
          });

          element.bind('keypress', function(event) {
            if(event.keyCode === 32) {
              event.preventDefault();
            }
          });
        }
      };
    })
</code></pre>