@Deprecated public boolean isValid(String regex){
  if (regex == null) {
    return false;
  }
  Pattern pattern=Pattern.compile(regex);
  Matcher matcher=pattern.matcher(getText());
  return matcher.matches();
}

@ Deprecated public boolean isValid ( String regex ) { if ( regex == null ) { return false ; } Pattern pattern = Pattern . compile ( regex ) ; Matcher matcher = pattern . matcher ( getText ( ) ) ; return matcher . matches ( ) ; }
if the main text matches the regex
