Home | History | Annotate | Download | only in js

Lines Matching full:regexp

14 var GlobalRegExp = global.RegExp;
34 // regexp match. The property RegExpLastMatchInfo includes the matchIndices
35 // array of the last successful regexp match (an array of start/end index
107 "RegExp.prototype.compile", this);
124 function DoRegExpExec(regexp, string, index) {
125 return %_RegExpExec(regexp, string, index, RegExpLastMatchInfo);
155 function RegExpExecNoTests(regexp, string, start) {
156 // Must be called with RegExp, string and positive integer as arguments.
157 var matchInfo = %_RegExpExec(regexp, string, start, RegExpLastMatchInfo);
160 if (REGEXP_STICKY(regexp)) regexp.lastIndex = matchInfo[CAPTURE1];
163 regexp.lastIndex = 0;
171 'RegExp.prototype.exec', this);
207 // One-element cache for the simplified test regexp.
218 'RegExp.prototype.test', this);
242 // Non-global, non-sticky regexp.
243 // Remove irrelevant preceeding '.*' in a test regexp. The expression
246 var regexp = this;
247 var source = REGEXP_SOURCE(regexp);
248 if (regexp.length >= 3 &&
249 %_StringCharCodeAt(regexp, 0) == 46 && // '.'
250 %_StringCharCodeAt(regexp, 1) == 42 && // '*'
251 %_StringCharCodeAt(regexp, 2) != 63) { // '?'
252 regexp = TrimRegExp(regexp);
255 var matchIndices = %_RegExpExec(regexp, string, 0, RegExpLastMatchInfo);
264 function TrimRegExp(regexp) {
265 if (!%_ObjectEquals(regexp_key, regexp)) {
266 regexp_key = regexp;
269 %_SubString(REGEXP_SOURCE(regexp), 2, REGEXP_SOURCE(regexp).length),
270 (REGEXP_IGNORE_CASE(regexp) ? REGEXP_MULTILINE(regexp) ? "im" : "i"
271 : REGEXP_MULTILINE(regexp) ? "m" : ""));
279 // RegExp.prototype.toString() returns '/(?:)/' as a compatibility fix;
287 'RegExp.prototype.toString', this);
301 // TODO(yangguo): allow non-regexp receivers.
304 "RegExp.prototype.@@split", this);
371 // TODO(yangguo): allow non-regexp receivers.
374 "RegExp.prototype.@@match", this);
387 // TODO(yangguo): allow non-regexp receivers.
390 "RegExp.prototype.@@search", this);
399 // rightContext of the RegExp constructor. The properties are computed based
462 // TODO(littledan): Remove this RegExp compat workaround
466 throw MakeTypeError(kRegExpNonRegExp, "RegExp.prototype.global");
470 %FunctionSetName(RegExpGetGlobal, "RegExp.prototype.global");
477 // TODO(littledan): Remove this RegExp compat workaround
481 throw MakeTypeError(kRegExpNonRegExp, "RegExp.prototype.ignoreCase");
485 %FunctionSetName(RegExpGetIgnoreCase, "RegExp.prototype.ignoreCase");
492 // TODO(littledan): Remove this RegExp compat workaround
496 throw MakeTypeError(kRegExpNonRegExp, "RegExp.prototype.multiline");
500 %FunctionSetName(RegExpGetMultiline, "RegExp.prototype.multiline");
507 // TODO(littledan): Remove this RegExp compat workaround
511 throw MakeTypeError(kRegExpNonRegExp, "RegExp.prototype.source");
515 %FunctionSetName(RegExpGetSource, "RegExp.prototype.source");
520 %FunctionSetInstanceClassName(GlobalRegExp, 'RegExp');