archives

« Bugzilla Issues Index

#913 — 15.10.5.13: RegExp.prototype.search needs a search algorthm


In 15.5.4.12 "String.prototype.search (regexp)",
step 7 says:
Search the value string from its beginning for an occurrence of the
regular expression pattern rx. ...

This seems vague. Compare to String.prototype.match, which (at a point roughly analogous to search's step 7) calls RegExpExec, which goes into great detail about how to apply a regexp to a string.

I understand that 'search' can't call RegExpExec, because RegExpExec *doesn't* ignore the regexp's 'lastIndex' and 'global' properties. But it seems like there should be something of comparable detail.


String.prototype.search now delegates to RegExp.prototype.search but it has the same vague language that used to be in the String method. However, there is already a margin TODO comment that says better spec. language is needed.

Changed the title of this bug so it relates to RegExp search


fixed in rev23 editor's draft


fixed in rev23 draft