Microsoft.JScript.RegExpObject.exec C# (CSharp) Method

exec() private method

private exec ( String input ) : Object
input String
return Object
      internal Object exec(String input){
        Match match = null;
        if (!this.globalInt)
          match = this.regex.Match(input);
        else{
          int lastIndex = (int)Runtime.DoubleToInt64(Convert.ToInteger(this.lastIndexInt));
          if (lastIndex <= 0)
            match = this.regex.Match(input);
          else if (lastIndex <= input.Length)
            match = this.regex.Match(input, lastIndex);
        }
        if (match == null || !match.Success){
          this.lastIndexInt = 0;
          return DBNull.Value;
        }
        this.lastIndexInt = this.regExpConst.UpdateConstructor(this.regex, match, input);
        return new RegExpMatch(this.regExpConst.arrayPrototype, this.regex, match, input);
      }

Usage Example

コード例 #1
0
        public static object exec(object thisob, object input)
        {
            RegExpObject obj2 = thisob as RegExpObject;

            if (obj2 == null)
            {
                throw new JScriptException(JSError.RegExpExpected);
            }
            if ((input is Missing) && !obj2.regExpConst.noExpando)
            {
                input = obj2.regExpConst.input;
            }
            return(obj2.exec(Microsoft.JScript.Convert.ToString(input)));
        }
All Usage Examples Of Microsoft.JScript.RegExpObject::exec