Share this page

com.hp.lft.sdk.web

## Class TextMatch

- java.lang.Object
- - com.hp.lft.sdk.web.TextMatch

-     public class TextMatch
      extends Object

  Class defining a text match we are looking for.
  Usage example:
  TextMatch textMatch = TextMatch.match("some text");
  TextMatch textMatch = TextMatch.match("some text", 2);

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `text`
    `protected Integer` | `textOccurrence`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `TextMatch()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static TextMatch` | `match(String text)` Returns the text match object which can be used to find the first match of the specified text.
    `static TextMatch` | `match(String text, int textOccurrence)` Returns the text match object which can be used to find the n-th match of the specified text.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### text

          protected String text

    - #### textOccurrence

          protected Integer textOccurrence

  - ### Constructor Detail

    - #### TextMatch

          protected TextMatch()

  - ### Method Detail

    - #### match

          public static TextMatch match(String text)

      Returns the text match object which can be used to find the first match of the specified text.
      Parameters:
        `text` - the text to search for.
      Returns:
        the text match object which can be used to find the first match of the specified text.

    - #### match

          public static TextMatch match(String text,
                        int textOccurrence)

      Returns the text match object which can be used to find the n-th match of the specified text.
      Parameters:
        `text` - the text to search for.
        `textOccurrence` - 0-based ordinal number of the text's occurrence.
      Returns:
        the text match object which can be used to find the n-th match of the specified text.

Tips to improve your search results... UFT Developer Java SDK Reference Version 15.0-15.0.2 UFT Developer SDK Reference All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: