public static Object getInjectValue(String string, boolean decrypt) {
        Matcher m = pattern.matcher(string);
        StringBuffer sb = new StringBuffer();
        // Parse the content inside pattern "${}" when this pattern is found
        while (m.find()) {
            // Get parsing result
            Object value = getValue(m.group(1), decrypt);
            // Return directly when the parsing result don't need to be cast to String
            if (!(value instanceof String)) {
                return value;
            }
            String valueStr = (String)value;
            if(valueStr.contains("\\$")) {
                m.appendReplacement(sb, (String)value);
            } else {
                m.appendReplacement(sb, Matcher.quoteReplacement((String)value));
            }
        }
        return m.appendTail(sb).toString();
    }
@Test
    @Ignore
    public void testGetInjectValueIssue744() {

        Object oldConfigValue = null;
        try {
            oldConfigValue = ConfigInjection.getInjectValue(value, true);
        } catch (Exception ce) {
            // expected exception since no valuemap defined yet.
            assertTrue(ce instanceof ConfigException);
        }
        assertNull(oldConfigValue);

        Map<String, Object> newValueMap = new HashMap<>();
        newValueMap.put(configKey, configValue);
        Config.getInstance().putInConfigCache(valueMapKey, newValueMap);

        Object newConfigValue = ConfigInjection.getInjectValue(value, true);

        assertNotNull(newConfigValue);
        assertEquals(configValue, newConfigValue);
    }