<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,5 @@
+* Refine the `reValidator` regexp. [jddalton, Diego Perini]
+
 * Remove unused methods getChildren() and getNextSibling(). [Diego Perini]
 
 * Rewrite client_api() to avoid extra optimizations that are handled better by the selector compiler. [Diego Perini, jddalton]</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -78,8 +78,9 @@ NW.Dom = (function(global) {
   // split last, right most, selector group token
   reSplitToken = /([^ &gt;+~,\\()[\]]+|\([^()]+\)|\(.*\)|\[[^[\]]+\]|\[.*\]|\\.)+/g,
 
-  // discard invalid chars found in passed selector
-  reValidator = /([.:#*\w]|[^\x00-\xa0])/,
+  // simple check to ensure the first character of a selector is valid
+  // http://www.w3.org/TR/2009/CR-CSS2-20090423/syndata.html#characters
+  reValidator = /^(?:[*a-zA-Z]|\[[\x20\t\n\r\fa-zA-Z]|[.:#*_]?(?!-?\d)(?:[-a-zA-Z]|[^\x00-\xa0]))/,
 
   // for use with the normilize method
   reEdgeSpaces     = new RegExp(strEdgeSpace, 'g'),</diff>
      <filename>src/nwmatcher.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e323c2becec6b6ed02c64b9451deb9546b6f61ae</id>
    </parent>
  </parents>
  <author>
    <name>jdalton</name>
    <email>john.david.dalton@gmail.com</email>
  </author>
  <url>http://github.com/jdalton/nwmatcher/commit/a4815a4af9a1130f9a91a40e97174bc8cc0fabdf</url>
  <id>a4815a4af9a1130f9a91a40e97174bc8cc0fabdf</id>
  <committed-date>2009-11-11T00:29:34-08:00</committed-date>
  <authored-date>2009-11-11T00:29:25-08:00</authored-date>
  <message>nwmatcher: Refine the `reValidator` regexp. [jddalton, Diego Perini]</message>
  <tree>96e6fc6e1ab3393f1aaa1b9326ae0d92d718ccbc</tree>
  <committer>
    <name>jdalton</name>
    <email>john.david.dalton@gmail.com</email>
  </committer>
</commit>
