Lines Matching full:regexp
178 function StringMatch(regexp) {
184 if (IS_REGEXP(regexp)) {
185 // Emulate RegExp.prototype.exec's side effect in step 5, even though
187 var lastIndex = regexp.lastIndex;
189 if (!regexp.global) return RegExpExecNoTests(regexp, subject, 0);
190 %_Log('regexp', 'regexp-match,%0S,%1r', [subject, regexp]);
191 // lastMatchInfo is defined in regexp.js.
192 var result = %StringMatch(subject, regexp, lastMatchInfo);
194 regexp.lastIndex = 0;
197 // Non-regexp argument.
198 regexp = new $RegExp(regexp);
199 return RegExpExecNoTests(regexp, subject, 0);
205 // needle is a string rather than a regexp. In this case we can't update
207 // RegExp object.
220 // .. regexp search
237 // Emulate RegExp.prototype.exec's side effect in step 5, even if
241 %_Log('regexp', 'regexp-replace,%0r,%1S', [search, subject]);
247 // Non-global regexp search, string replace.
262 // Global regexp search, string replace.
285 // Global regexp search, function replace.
288 // Non-global regexp search, function replace.
429 function StringReplaceGlobalRegExpWithFunction(subject, regexp, replace) {
440 var res = %RegExpExecMultiple(regexp,
444 regexp.lastIndex = 0;
453 // the regexp, just the implicit capture that captures the whole match. In
466 // RegExp.leftContext work during the callback function.
490 // Use the apply argument as backing for global RegExp properties.
506 function StringReplaceNonGlobalRegExpWithFunction(subject, regexp, replace) {
507 var matchInfo = DoRegExpExec(regexp, subject, 0);
509 regexp.lastIndex = 0;
550 var regexp;
552 regexp = %_GetFromCache(STRING_TO_REGEXP_CACHE_ID, re);
554 regexp = re;
556 regexp = new $RegExp(re);
558 var match = DoRegExpExec(regexp, TO_STRING_INLINE(this), 0);
651 %_Log('regexp', 'regexp-split,%0S,%1r', [subject, separator]);