Whether the string is a valid expression.

@param string
the string
@return true if the string starts with '${' and ends with '}', false
otherwise
432621
static boolean isExpression(final String string) {
    if (string == null) {
      return false;
    }
    return string.startsWith("${") && string.endsWith("}");
  }
128010
public static void validate(final String string, final List<String> params) {
        final List<String> vars = findVars(string);
        for (String param : params) {
            Preconditions.checkState(vars.contains(param),
                    "Variable '%s' not found in target string '%s'", param, string);
        }
        vars.removeAll(params);
        Preconditions.checkState(vars.isEmpty(),
                "No parameter binding defined for variables '%s' from string '%s'",
                Joiner.on(',').join(vars), string);
    }
142546
public static function isValid($value)
    {
        if (is_string($value)) {
            $value = [ $value ];
        }
        
        if (!is_array($value) || count($value) === 0) {
            return false;
        }

        foreach ($value as $ep) {
            if (!is_string($ep)) {
                return false;
            }
            $type = self::getType($ep);

            if ($type === null) {
                return false;
            }
        }
        return true;
    }
83644
public static final boolean isValid(final String value) {
        if (value == null) {
            return true;
        }
        final Locale locale;
        final int p = value.indexOf("__");
        if (p > -1) {
            locale = new Locale(value.substring(0, p), null, value.substring(p + 2));
        } else {
            final StringTokenizer tok = new StringTokenizer(value, "_");
            if (tok.countTokens() == 1) {
                locale = new Locale(value);
            } else if (tok.countTokens() == 2) {
                locale = new Locale(tok.nextToken(), tok.nextToken());
            } else if (tok.countTokens() == 3) {
                locale = new Locale(tok.nextToken(), tok.nextToken(), tok.nextToken());
            } else {
                return false;
            }
        }
        return LocaleConverter.validLocale(locale);
    }
436513
public void endsWith(String string) {
    checkNotNull(string);
    if (actual() == null) {
      failWithActual("expected a string that ends with", string);
    } else if (!actual().endsWith(string)) {
      failWithActual("expected to end with", string);
    }
  }
944948
public static boolean isValidJavaIdentifier(String str) {
    if (isNullOrEmpty(str)) {
      return false;
    }
    if (JAVA_KEYWORDS.contains(str)) {
      return false;
    }
    if (!Character.isJavaIdentifierStart(str.charAt(0))) {
      return false;
    }
    for (int i = 1; i < str.length(); i++) {
      if (!Character.isJavaIdentifierPart(str.charAt(i))) {
        return false;
      }
    }
    return true;
  }
499563
public static function isJson (string $string) : bool
    {
        if (is_numeric($string) || $string === 'true' || $string === 'false' || $string === 'null' || empty($string)) :
            return false;
        endif;

        // try to decode string
        json_decode($string);

        // check if error occured
        return json_last_error() === JSON_ERROR_NONE;
    }
496034
protected function hasExpressions(string $string): bool
    {
        foreach (self::STOPS as $symbol) {
            if (strpos($string, $symbol) !== false) {
                return true;
            }
        }

        return false;
    }
514093
public static function endsWith($string, $ending)
    {
        if (1 === strlen($ending) && !self::isLetterOrDigit($ending)) {
            $ending = '\\' . $ending;
        }

        return (bool)preg_match('|' . $ending . '$|', $string);
    }
1143936
public static boolean isValid(String s) {
    try {
      new URI(UriEncoder.encode(s));
    }
    catch (URISyntaxException e) {
      return false;
    }
    return true;
  }
1181138
public boolean isValid(String value) {
    if (value == null) {
      return false;
    }
    for (int i = 0; i < patterns.length; i++) {
      if (patterns[i].matcher(value).matches()) {
        return true;
      }
    }
    return false;
  }
29068
private static function containsEscapeCharacters($string)
    {
        $escapeCodePattern = '#' . static::ANSI_ESCAPE_CODE_REGEX . '#';
        $result            = preg_match($escapeCodePattern, $string);

        return (boolean) $result;
    }
1304175
public static boolean isValidationMatcherExpression(String expression) {
        return expression.startsWith(Citrus.VALIDATION_MATCHER_PREFIX) &&
                expression.endsWith(Citrus.VALIDATION_MATCHER_SUFFIX);
    }
1349267
public static boolean isValidJmxPropertyValue(String s) {
        if ((s.indexOf(":") >= 0)
            || (s.indexOf("*") >= 0)
            || (s.indexOf('"') >= 0)
            || (s.indexOf("?") >= 0)
            || (s.indexOf(",") >= 0)
            || (s.indexOf("=") >= 0)) {
            return false;
        } else
            return true;
    }
272687
public static function isClass($string)
    {
        if (is_string($string) === true) {
            $pattern = "/^(?:[^\s]+?(?:\x20){0,})+$/";
    
            return preg_match($pattern, $string) === 1;
        } else {
            
            return false;
        }
    }
14242
public static boolean isValid(String token)
    {
        if (token == null || token.length() == 0)
        {
            return false;
        }

        int len = token.length();

        for (int i = 0; i < len; ++i)
        {
            if (isSeparator(token.charAt(i)))
            {
                return false;
            }
        }

        return true;
    }
823040
public function matches(string $string) : bool
    {
        $matches = [];

        return (bool)call_user_func_array(
            $this->_method,
            [
                sprintf("/%s/%s", $this->_expr, $this->_flags),
                $string,
                &$matches,
                $this->_pregMatchFlags ?: null,
            ]
        );
    }