forbes at lindesay.co.uk (2014-07-16T22:34:58.546Z)
```js
r = /\u0020+$/g; p = r.exec(" "); q = r.exec(" "); JSON.stringify([p, q])
// "[[\" \"],null]"
```
Why does calling exec the second time generate null? When I try the
regular expression without the /g flag, I get:
```js
// "[[\" \"],[\" \"]]"
```
r = /\u0020+$/g; p = r.exec(" "); q = r.exec(" "); JSON.stringify([p, q]) // "[[\" \"],null]" Why does calling exec the second time generate null? When I try the regular expression without the /g flag, I get: // "[[\" \"],[\" \"]]" -- "The first step in confirming there is a bug in someone else's work is confirming there are no bugs in your own." -- Alexander J. Vincent, June 30, 2001 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140716/8d5c5fdd/attachment.html>