private String determineEvidence(String contents, String blockVariable, String fieldPattern) {
        String value = "";

        //capture array value between [ ]
        final Matcher arrayMatcher = Pattern.compile(
                String.format("\\s*?%s\\.%s\\s*?=\\s*?\\{\\s*?(.*?)\\s*?\\}", blockVariable, fieldPattern),
                Pattern.CASE_INSENSITIVE).matcher(contents);
        if (arrayMatcher.find()) {
            value = arrayMatcher.group(1);
        } else { //capture single value between quotes
            final Matcher matcher = Pattern.compile(
                    String.format("\\s*?%s\\.%s\\s*?=\\s*?(['\"])(.*?)\\1", blockVariable, fieldPattern),
                    Pattern.CASE_INSENSITIVE).matcher(contents);
            if (matcher.find()) {
                value = matcher.group(2);
            }
        }
        return value;
    }
private String determineEvidence ( String contents , String blockVariable , String fieldPattern ) { String value = "" ; final Matcher arrayMatcher = Pattern . compile ( String . format ( "\\s*?%s\\.%s\\s*?=\\s*?\\{\\s*?(.*?)\\s*?\\}" , blockVariable , fieldPattern ) , Pattern . CASE_INSENSITIVE ) . matcher ( contents ) ; if ( arrayMatcher . find ( ) ) { value = arrayMatcher . group ( 1 ) ; } else { final Matcher matcher = Pattern . compile ( String . format ( "\\s*?%s\\.%s\\s*?=\\s*?(['\"])(.*?)\\1" , blockVariable , fieldPattern ) , Pattern . CASE_INSENSITIVE ) . matcher ( contents ) ; if ( matcher . find ( ) ) { value = matcher . group ( 2 ) ; } } return value ; }
Extracts evidence from the contents and adds it to the given evidence
collection.

@param contents the text to extract evidence from
@param blockVariable the block variable within the content to search for
@param fieldPattern the field pattern within the contents to search for
@return the evidence