regexSpace.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. (function() {
  6. spc = /^\s$/,
  7. range = 0xFFFF;
  8. var fillZero = (function() {
  9. var tmp = [];
  10. return function(num, n) {
  11. var nnum;
  12. num += "";
  13. if (num.length < n) {
  14. if (!tmp[n]) {
  15. z = tmp[n] = new Array(n).join('0');
  16. } else {
  17. z = tmp[n];
  18. }
  19. num = z + num;
  20. nnum = num.length
  21. num = num.substring(nnum-n, nnum);
  22. }
  23. return num;
  24. };
  25. })();
  26. WScript.Echo("start");
  27. for (r = 0x00; r < range; r++) {
  28. if (spc.test(String.fromCharCode(r))) {
  29. WScript.Echo('\\u'+fillZero(r.toString(16), 4));
  30. }
  31. }
  32. })();