Class RegExpResult


  • @JsType(isNative=true,
            name="Array",
            namespace="<global>")
    public final class RegExpResult
    extends Array
    Array object which maps the java script object.
    A simple wrapper around a homogeneous native array of string values.
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • index

        @JsProperty(name="index")
        public final int index()
        Returns the 0-based index of the match in the string.
        Returns:
        the 0-based index of the match in the string.
      • input

        @JsProperty(name="input")
        public final String input()
        Returns the original string that was matched against.
        Returns:
        the original string that was matched against.
      • lastIndexOf

        public int lastIndexOf​(String value)
        Returns the index of the last occurrence of the specified element in this array, or -1 if this array does not contain the element.
        Parameters:
        value - element to search for
        Returns:
        the index of the last occurrence of the specified element in this array, or -1 if this array does not contain the element
      • indexOf

        public int indexOf​(String value)
        Returns the index of the first occurrence of the specified element in this array, or -1 if this array does not contain the element.
        Parameters:
        value - element to search for
        Returns:
        the index of the first occurrence of the specified element in this array, or -1 if this array does not contain the element
      • get

        @JsOverlay
        public String get​(int index)
        Gets the value at a given index. If no value exists at the given index, a type-conversion error will occur in Development Mode and unpredictable behavior may occur in Production Mode. If the numeric value returned is non-integral, it will cause a warning in Development Mode, and may affect the results of mathematical expressions.
        Parameters:
        index - the index to be retrieved
        Returns:
        the value at the given index
      • groups

        @JsOverlay
        public <T extends NativeObjectContainer> T groups​(NativeObjectContainerFactory<T> factory)
        Returns the object to refer to certain token by string that a regular expression matches.
        Type Parameters:
        T - type of native object container
        Parameters:
        factory - native container factory in order to map the result of regular expression execution
        Returns:
        the object to refer to certain token by string that a regular expression matches