Does the RegExp /y modifier require /g?

2007-12-24 Thread StevenLevithan
(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

Re: Regex: How should backreferences contained in the capturing match they reference to work?

2007-11-26 Thread StevenLevithan
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

Re: Regex: How should backreferences contained in the capturing match they reference to work?

2007-11-26 Thread StevenLevithan
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

Suggest adopting .NET/Perl regexp named capture syntax

2007-10-24 Thread StevenLevithan
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