public static boolean checkRegexResourceField(AbstractRule rule) {
        if (!rule.isRegex()) {
            return true;
        }
        String resourceName = rule.getResource();
        try {
            Pattern.compile(resourceName);
            return true;
        } catch (Exception e) {
            return false;
        }
    }
@Test
    public void testValidRegexRule() {
        // Setup
        FlowRule flowRule = new FlowRule();
        flowRule.setRegex(true);
        flowRule.setResource("{}");
        // Run the test and verify
        Assert.assertFalse(RuleManager.checkRegexResourceField(flowRule));

        flowRule.setResource(".*");
        // Run the test and verify
        Assert.assertTrue(RuleManager.checkRegexResourceField(flowRule));
    }