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 lookahead
> 

I am in complete agreement with liorean. The ES3 handling on these points is
non-intuitive, non-compatible with other regex libraries, *far* less useful
than the alternative (I could give countless examples of where the
Perl-style handling has real-world practicality), and creates future
compatibility issues if ECMAScript were to implement certain features from
Perl or other Perl-derivative flavors such as capturing-group-based
conditionals.



Lars T Hansen wrote:
> 
>> I hope I'm not being overly flip when I say that it is the spec that
>> circumscribes the set of expectations you are allowed to have.  And
>> the spec is entirely clear here, ie what it says is not in question,
>> even if it's not always easy to find out what it says.  A somewhat
>> determined developer who needs to rely on the behavior can discover
>> what behavior is expected (though he obviously can't trust the
>> implementations to get it right).
> 

I consider ES3's handling of capturing group participation and so forth
(summed up by liorean) to be bugs in the spec (perhaps I'm being overly
flip, but these are my biggest gripes with ES3 regexes). The fact that I
consider them bugs which might be fixed in future versions means that I
cannot rely on the behavior even though I understand what the spec
prescribes.

-- 
View this message in context: 
http://www.nabble.com/Regex%3A-How-should-backreferences-contained-in-the-capturing-match-they-reference-to-work--tf4367560.html#a13946131
Sent from the Mozilla - ECMAScript 4 discussion mailing list archive at 
Nabble.com.

_______________________________________________
Es4-discuss mailing list
Es4-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss

Reply via email to