code: function (sel) {
          var valid = false;
  
          if (sel && lang.isString(sel)) {
  
              if (!selectors.hasOwnProperty(sel)) {
                  // TEST: there should be nothing but white-space left after
                  // these destructive regexs
                  selectors[sel] = !/\S/.test(
                      // combinators
                      sel.replace(/\s+|\s*[+~>]\s*/g,' ').
                      // attribute selectors (contents not validated)
                      replace(/([^ ])\[.*?\]/g,'$1').
                      // pseudo-class|element selectors (contents of parens
                      // such as :nth-of-type(2) or :not(...) not validated)
                      replace(/([^ ])::?[a-z][a-z\-]+[a-z](?:\(.*?\))?/ig,'$1').
                      // element tags
                      replace(/(?:^| )[a-z0-6]+/ig,' ').
                      // escaped characters
                      replace(/\\./g,'').
                      // class and id identifiers
                      replace(/[.#]\w[\w\-]*/g,''));
              }
  
              valid = selectors[sel];
          }
  
          return valid;
      }
docs: <p>Determines if a selector string is safe to use.  Used internally
  in set to prevent IE from locking up when attempting to add a rule for a
  &quot;bad selector&quot;.</p>
  
  <p>Bad selectors are considered to be any string containing unescaped
  `~!@$%^&()+=|{}[];'"?< or space. Also forbidden are . or # followed by
  anything other than an alphanumeric.  Additionally -abc or .-abc or
  #_abc or '# ' all fail.  There are likely more failure cases, so
  please file a bug if you encounter one.</p>
  
  @method StyleSheet.isValidSelector
  @param sel {String} the selector string
  @return {Boolean}
  @static