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