rhino/testsrc/doctests/regexp.literals.doctest
raw| 1 | // This Source Code Form is subject to the terms of the Mozilla Public |
| 2 | // License, v. 2.0. If a copy of the MPL was not distributed with this |
| 3 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 4 | |
| 5 | js> for (var i = 0; i < 4; i++) print(/a/g.exec("a")); |
| 6 | a |
| 7 | a |
| 8 | a |
| 9 | a |
| 10 | js> var r = /a/g; for (var i = 0; i < 4; i++) print(r.exec("a")); |
| 11 | a |
| 12 | null |
| 13 | a |
| 14 | null |
| 15 |