clampNumericQuantifier.js 599 B

123456789101112131415161718
  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 assert(b) {
  6. if (!b) {
  7. print('fail');
  8. }
  9. }
  10. let p1 = new RegExp('^[a-z]{2,2147483648}$');
  11. assert(!p1.test('a'));
  12. let p2 = /^[a-z]{2,2147483648}$/;
  13. assert(p2.test('aaaaa'));
  14. print('PASS');