diff --git a/src/nwmatcher.js b/src/nwmatcher.js
index <HASH>..<HASH> 100644
--- a/src/nwmatcher.js
+++ b/src/nwmatcher.js
@@ -69,9 +69,13 @@ NW.Dom = (function(global) {
   reIdSelector = /\#([-\w]+)$/,
   reWhiteSpace = /[\x20\t\n\r\f]+/g,
 
+  // match missing R/L context
   reLeftContext = /^\s*[>+~]+/,
   reRightContext = /[>+~]+\s*$/,
 
+  // match the document type
+  reDocumentType = / [XHTML]+ /,
+
   /*----------------------------- UTILITY METHODS ----------------------------*/
 
   slice = Array.prototype.slice,
added regular expression to aid in guessing document type, added missing comment