code: function _buildRegexFromString(regex) {
  
          if (!regex || (typeof regex !== "string" && !(regex instanceof RegExp))) {
              _regexDebug();
              return false;
          }
  
          if (typeof regex !== 'string') {
              regex = regex.toString();
          }
  
          var separator = regex.charAt(0),
              index = regex.length - 1,
              pattern,
              modifier,
              rule;
  
          while (index > 0) {
              if (/[gimsxeU]/.test(regex.charAt(index))) {
                  index--;
              } else {
                  break;
              }
          }
  
          if (regex.charAt(index) !== separator) {
              separator = null;
          }
  
          if (separator && index !== regex.length - 1) {
              modifier = regex.substr(index + 1, regex.length - 1);
          }
  
          if (separator) {
              pattern = regex.substr(1, index - 1);
          } else {
              pattern = regex;
          }
  
          try {
              rule = new RegExp(pattern, modifier);
          } catch (error) {
              _regexDebug();
              return false;
          }
  
          return rule;
  
          function _regexDebug() {
              // {debug}
              window.Debug.log({
                  'function': '_buildRegexFromString()',
                  'arguments': '{pattern: {' + (pattern || '') + '}, modifier: {' + (modifier || '') + '}',
                  'message': 'WARNING - Invalid regex given: ' + regex
              });
              window.Debug.print();
              // {/debug}
          }
  
      }
docs: @private
  Converts string into a regex
  
  @param {String|Object} regex
  @returns {Object|Boolean} rule