dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/CocoaPodsAnalyzer.java
/**
     * Extracts evidence from the contents and adds it to the given evidence
     * collection.
     *
     * @param evidences the evidence collection to update
     * @param contents the text to extract evidence from
     * @param blockVariable the block variable within the content to search for
     * @param field the name of the field being searched for
     * @param fieldPattern the field pattern within the contents to search for
     * @param confidence the confidence level of the evidence if found
     * @return the string that was added as evidence
     */
Extracts evidence from the contents and adds it to the given evidence
collection.


Extracts evidence from the contents and adds it to the given evidence collection .
private String addStringEvidence(EvidenceCollection evidences, String contents,
            String blockVariable, String field, String fieldPattern, Confidence confidence) {
        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);
            }
        }
        if (value.length() > 0) {
            evidences.addEvidence(PODSPEC, field, value, confidence);
        }
        return value;
    }
private String addStringEvidence ( EvidenceCollection evidences , String contents , String blockVariable , String field , String fieldPattern , Confidence confidence ) { 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 ) ; } } if ( value . length ( ) > 0 ) { evidences . addEvidence ( PODSPEC , field , value , confidence ) ; } return value ; }
Extracts evidence from the contents and adds it to the given evidence
 collection.
Extracts evidence from the contents and adds it to the given evidence collection .
//capture array value between [ ] //capture single value between quotes