(I emailed this to the list last night, but it doesn't seem to have gone
through. Sorry if this becomes a dupe.)
-
As far as I understand from ECMA-262 3rd Edition, the regexp.lastIndex
property is meaningless if a regexp does not use the /g modifier. Quoting
from E262v3 ยง15.10.6.2
liorean wrote:
I think I can sum up the change I think is appropriate by these things:
- undefined should be a failure to match instead of a match to the empty
string
- captures should only be set to undefined in two cases - when the
regex matching is started, and if inside a negative
StevenLevithan wrote:
liorean wrote:
I think I can sum up the change I think is appropriate by these things:
- undefined should be a failure to match instead of a match to the empty
string
- captures should only be set to undefined in two cases - when the
regex matching is started
ECMAScript 4 regular expression extension proposals indicate that the Python
syntax will be used for named capture. Python uses (?Pname...) for named
capture, (?P=name) for a backreference within the regex, and \gname for a
backreference within a replacement string. Personally, I feel this a