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 (RegExp.pr

Re: Does the RegExp /y modifier require /g?

2007-12-24 Thread Brendan Eich
On Dec 24, 2007, at 8:44 AM, StevenLevithan wrote: > (I emailed this to the list last night, but it doesn't seem to have > gone > through. Sorry if this becomes a dupe.) (I don't see a moderator request based on your sending from a different e-mail address -- I don't see a dup either.) > Giv

Re: Does the RegExp /y modifier require /g?

2007-12-24 Thread Steve
>> 1. Does ES4's /y (sticky) modifier have any meaning if the /g (global) >> modifier is not also set? > > Yes. My question was very poorly worded. I was thinking along the lines of behavior being affected by lastIndex (set manually or via the use of /g). > The /y flag makes unanchored regexps m