public String findInContent ( String content ) { // First check for a simple exact occurrence for ( BoyerMooreMatcher matcher : strings ) { if ( matcher . findInContent ( content ) >= 0 ) return matcher . getPattern ( ) ; } // Then check for a regex occurrence Matcher matcher ; for ( Pattern pattern : patterns ) { matcher = pattern . matcher ( content ) ; if ( matcher . find ( ) ) { return matcher . group ( ) ; } } // No match found return null return null ; }
Search for an occurrence inside a specific content