title: Regex to Allow a Special Character (:) and numbers and alphabets only
body: <p>I am using AngularJS directive for my form input validation .Is there a way to make my regex allow only one special character(:)along with numbers and alphabets . This is the directive i found on stackoverflow.</p>
  
  <pre><code>        myapp.directive('noSpecialChar', function() {
      return {
          require: 'ngModel',
          restrict: 'A',
          link: function(scope, element, attrs, modelCtrl) {
              modelCtrl.$parsers.push(function(inputValue) {
                  if (inputValue == null)
                      return ''
                      cleanInputValue = inputValue.replace(/[^\w\s]/gi, '');
                      cleanInputValue = cleanInputValue.toUpperCase();
                  if (cleanInputValue != inputValue) {
                      modelCtrl.$setViewValue(cleanInputValue);
                      modelCtrl.$render();
                  }
                  return cleanInputValue;
              });
          }
      }
  });
  </code></pre>
  
  <p>I tried adding colon at the end , but i'm unable to reach my solution .</p>