code: public boolean isTextPresent(String pattern) {
          String text = getElement().getText();
          return (text != null && (text.contains(pattern) || text.matches(pattern)));
      }
docs: It is to check whether the element's text matches with the specified pattern.
  
  @param pattern
  regular expression
  
  @return boolean <b>true</b> - the element's text matches with the pattern. <br>
  <b>false</b> the element's text doesn't match with the pattern.