Home | History | Annotate | Download | only in src

Lines Matching refs:RegExp

141 function StringMatchJS(regexp) {
145 if (IS_REGEXP(regexp)) {
146 // Emulate RegExp.prototype.exec's side effect in step 5, even though
148 var lastIndex = regexp.lastIndex;
150 if (!regexp.global) return RegExpExecNoTests(regexp, subject, 0);
151 // lastMatchInfo is defined in regexp.js.
152 var result = %StringMatch(subject, regexp, lastMatchInfo);
154 regexp.lastIndex = 0;
157 // Non-regexp argument.
158 regexp = new $RegExp(regexp);
159 return RegExpExecNoTests(regexp, subject, 0);
187 // needle is a string rather than a regexp. In this case we can't update
189 // RegExp object.
200 // .. regexp search
217 // Emulate RegExp.prototype.exec's side effect in step 5, even if
226 // Non-global regexp search, string replace.
241 // Global regexp search, string replace.
264 // Global regexp search, function replace.
267 // Non-global regexp search, function replace.
408 function StringReplaceGlobalRegExpWithFunction(subject, regexp, replace) {
419 var res = %RegExpExecMultiple(regexp,
423 regexp.lastIndex = 0;
432 // the regexp, just the implicit capture that captures the whole match. In
445 // RegExp.leftContext work during the callback function.
469 // Use the apply argument as backing for global RegExp properties.
485 function StringReplaceNonGlobalRegExpWithFunction(subject, regexp, replace) {
486 var matchInfo = DoRegExpExec(regexp, subject, 0);
488 regexp.lastIndex = 0;
527 var regexp;
529 regexp = %_GetFromCache(STRING_TO_REGEXP_CACHE_ID, re);
531 regexp = re;
533 regexp = new $RegExp(re);
535 var match = DoRegExpExec(regexp, TO_STRING_INLINE(this), 0);