code: public Elements getElementsMatchingText(String regex) {
          Pattern pattern;
          try {
              pattern = Pattern.compile(regex);
          } catch (PatternSyntaxException e) {
              throw new IllegalArgumentException("Pattern syntax error: " + regex, e);
          }
          return getElementsMatchingText(pattern);
      }
docs: Find elements whose text matches the supplied regular expression.
  @param regex regular expression to match text against. You can use <a href="http://java.sun.com/docs/books/tutorial/essential/regex/pattern.html#embedded">embedded flags</a> (such as (?i) and (?m) to control regex options.
  @return elements matching the supplied regular expression.
  @see Element#text()