code: function emitCharsWhile(pattern) {
      pattern.lastIndex = nextchar-1;
      var match = pattern.exec(chars)[0];
      if (!match) return false;
      emitCharString(match);
      nextchar += match.length - 1;
      return true;
    }
docs: emit a string of chars that match a regexp Returns false if no chars matched.