prioritizedalternatives.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. WScript.Echo(/(a|ab)/.exec("ab"));
  6. WScript.Echo(/(ab|a)/.exec("ab"));
  7. r = /(aaab|aaa)/;
  8. a = "aaabab";
  9. WScript.Echo(a.match(r));
  10. r = /(aaa|aaab)/;
  11. a = "aaabab";
  12. WScript.Echo(a.match(r));
  13. r = /(a|ab)*/;
  14. a = "abab";
  15. WScript.Echo(a.match(r));
  16. r = /((a|ab)*)?/;
  17. a = "abab";
  18. WScript.Echo(a.match(r));
  19. r = /(a|ab)?/;
  20. a = "abab";
  21. WScript.Echo(a.match(r));
  22. r = /(p\/.*)?(.*)/;
  23. a = "p/u";
  24. var result = r.exec(a);
  25. WScript.Echo(result+"");
  26. var x = new RegExp("(([^:]*)://([^:/?]*)(:([0-9]+))?)?([^?#]*)([?]([^#]*))?(#(.*))?");
  27. var y = "http://shop.ebay.com/i.html?rt=nc&LH_FS=1&_nkw=dell+optiplex&_fln=1&_trksid=p3286.c0.m283";
  28. WScript.Echo(y.match(x));