regex_assertion.js 737 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. // This is a variant of the prototype regex for finding CSS classes
  6. // that was causing problems on CNN.com because it had classes
  7. // with -'s in their names
  8. WScript.Echo("b-b".match(/([\w\-\*]+)\b/));
  9. // Here is a simpler repro of the above:
  10. WScript.Echo("one two".match(/.*\b/));
  11. // TODO - fix this:
  12. //WScript.Echo(("a a a aa").match(/([a ]\b)*\b/));