match_global.js 588 B

123456789101112131415
  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. var p = /(\d*)(\D*)/g;
  6. var s = "123!234!567";
  7. while (true)
  8. {
  9. var r = p.exec(s);
  10. WScript.Echo("result=" + r);
  11. WScript.Echo("p.lastIndex=" + p.lastIndex);
  12. if (r[0].length == 0) { break; }
  13. }