public static Pattern getHardcodeSearchPattern(String hdpVersion) {
    // Only things like -Dhdp.version=2.3.4.0-1234 are allowed at hardcode
    return Pattern.compile("(?<!-Dhdp\\.version=)" + hdpVersion.replace(".", "\\."));
  }
Returns pattern that looks for hdp version hardcoded occurences, except
those that start with "-Dhdp.version=" string
@param hdpVersion hdp version to search for
@return compiled pattern
ambari-server/src/main/java/org/apache/ambari/server/checks/HardcodedStackVersionPropertiesCheck.java