根据正则表达式检查字符串是否是正常值（含冒号），不是则抛出异常

@param configKey   配置项
@param configValue 配置值
@param pattern     正则表达式
@param message     消息
@throws SofaRpcRuntimeException
557731
protected static void checkPattern(String configKey, String configValue, Pattern pattern, String message)
        throws SofaRpcRuntimeException {
        if (configValue != null && !match(pattern, configValue)) {
            throw ExceptionUtils.buildRuntime(configKey, configValue, message);
        }
    }
1340698
public void setPattern(String name, Pattern pattern) {
        if (null == pattern) {
            set(name, null);
        } else {
            set(name, pattern.pattern());
        }
    }
1088091
public void setReleaseTagsAfterEnd(String configValue) {

        OpenCms.getSystemInfo().getServletContainerSettings().setReleaseTagsAfterEnd(
            Boolean.valueOf(configValue).booleanValue());
    }
81074
public void setConfig(Map<String, ? extends CacheConfig> config) {
        this.configMap = (Map<String, CacheConfig>) config;
    }
948676
public function value(string $category_key, string $config_key)
    {
        if (!($category = ConfigCategory::where('key', $category_key)->first())) {
            throw new \Exception("Category with name ($category_key) not found");
        }
        if (!($config = $category->configs()->where('key', $config_key)->first())) {
            throw new \Exception("Config with name ($config_key) not found");
        }
        return $config->value;
    }
79927
public static Pattern pattern(AbstractConfig config, String key) {
    String pattern = config.getString(key);

    try {
      return Pattern.compile(pattern);
    } catch (PatternSyntaxException e) {
      throw new ConfigException(
          key,
          pattern,
          String.format(
              "Could not compile regex '%s'.",
              pattern
          )
      );
    }
  }
239679
public void setPattern(NumberPattern pattern, int _maxSigDigits, int _minSigDigits) {
    Format format = pattern.format();
    minIntDigits = orDefault(options.minimumIntegerDigits(), format.minimumIntegerDigits());

    maxFracDigits = currencyDigits == -1 ? format.maximumFractionDigits() : currencyDigits;
    maxFracDigits = orDefault(options.maximumFractionDigits(), maxFracDigits);

    minFracDigits = currencyDigits == -1 ? format.minimumFractionDigits() : currencyDigits;
    minFracDigits = orDefault(options.minimumFractionDigits(), minFracDigits);

    boolean useSignificant = formatMode == SIGNIFICANT || formatMode == SIGNIFICANT_MAXFRAC;
    if (useSignificant) {
        maxSigDigits = orDefault(options.maximumSignificantDigits(), _maxSigDigits);
        minSigDigits = orDefault(options.minimumSignificantDigits(), _minSigDigits);
    } else {
        maxSigDigits = -1;
        minSigDigits = -1;
    }
  }
975690
public void writeStringValue(HKey hk, String key, String valueName, String value) throws RegistryException {
		try {
			ReflectedMethods.writeStringValue(hk.root(), hk.hex(), key, valueName, value);
		} catch (Exception e) {
			throw new RegistryException("Cannot write " + valueName + " value " + value + " in key " + key, e);
		}
	}
529175
public MarcField matchValue(Pattern pattern) {
        if (value != null && pattern.matcher(value).matches()) {
            return this;
        }
        for (Subfield subfield : subfields) {
            if (pattern.matcher(subfield.getValue()).matches()) {
                return this;
            }
        }
        return null;
    }
395109
private static String getDatasetFromConfigKey(ConfigKeyPath configKey) {
    return StringUtils.removeStart(configKey.getAbsolutePathString(), SingleLinkedListConfigKeyPath.PATH_DELIMETER);
  }
1272992
private void parseLoggerConfig(final Node node,
			final ConfigSettings config, final ConfigurationKeys logPath,
			final ConfigurationKeys logLevel)
	{

		String name, value;
		Level level;
		Node nnode;
		NodeList list = node.getChildNodes();

		int length = list.getLength();
		for (int i = 0; i < length; i++) {
			nnode = list.item(i);

			name = nnode.getNodeName().toUpperCase();
			if (name.equals(KEY_LOG_PATH)) {

				value = nnode.getChildNodes().item(0).getNodeValue();
				value = value.substring(1, value.length() - 1);
				config.setConfigParameter(logPath, value);

			}
			else if (name.equals(KEY_LOG_LEVEL)) {

				level = Level.valueOf(nnode.getChildNodes().item(0)
						.getNodeValue());
				config.setConfigParameter(logLevel, level);
			}
		}
	}
1070218
private void createAndAddButton(PatternType pattern, String messageKey) {

        CmsRadioButton btn = new CmsRadioButton(pattern.toString(), Messages.get().key(messageKey));
        btn.addStyleName(I_CmsWidgetsLayoutBundle.INSTANCE.widgetCss().radioButtonlabel());
        btn.setGroup(m_groupPattern);
        m_patternButtons.put(pattern, btn);
        m_patternRadioButtonsPanel.add(btn);

    }
610848
@Override
    public String keyDefault(String keyName, String defaultValue) {

        if (hasConfigValue(keyName)) {
            return getConfigValue(keyName);
        }
        return m_messages.keyDefault(keyName, defaultValue);
    }
818625
@Override
	public void onPMessage(String pattern, String channel, String message) {
		System.out.println(pattern + "=" + channel + "=" + message);
	}
443391
private void doKeySet(final Message<JsonObject> message) {
    final String key = message.body().getString("name");
    if (key == null) {
      message.reply(new JsonObject().putString("status", "error").putString("message", "No key specified."));
      return;
    }

    final Object value = message.body().getValue("value");

    context.execute(new Action<Void>() {
      @Override
      public Void perform() {
        data.getMap(formatKey("keys")).put(key, value);
        return null;
      }
    }, new Handler<AsyncResult<Void>>() {
      @Override
      public void handle(AsyncResult<Void> result) {
        if (result.failed()) {
          message.reply(new JsonObject().putString("status", "error").putString("message", result.cause().getMessage()));
        } else {
          message.reply(new JsonObject().putString("status", "ok"));
        }
      }
    });
  }
869341
public static void patternFail(int number, String msg, ILexLocation location)
			throws PatternMatchException
	{
		throw new PatternMatchException(number, msg, location);
	}
1084439
@Override
    public void setConfiguration(
                    final Properties config
                    )
    throws ValidityException
    {
        String  pattern = config.getProperty( "pattern" );
        if (pattern == null) {
            throw new ValidityException( "no 'pattern' parameter" );
        }

        try {
            _formatter = new SimpleDateFormat( pattern );
                         //throws IllegalArgumentException
        } catch (Exception ex) {
            throw new ValidityException( "invalid 'pattern' parameter: "
                            + ex.getMessage() );
        }
    }