Class RedisUtils
java.lang.Object
org.evomaster.client.java.controller.redis.RedisUtils
Utils class for auxiliary operations in Redis heuristic value calculations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringredisPatternToRegex(String redisPattern) Translates a Redis glob-style pattern into a valid Java regex pattern.
-
Constructor Details
-
RedisUtils
public RedisUtils()
-
-
Method Details
-
redisPatternToRegex
Translates a Redis glob-style pattern into a valid Java regex pattern. Supported glob-style patterns: h?llo matches hello, hallo and hxllo h*llo matches hllo and heeeello h[ae]llo matches hello and hallo, but not hillo h[^e]llo matches hallo, hbllo, ... but not hello h[a-b]llo matches hallo and hbllo Use \ to escape special characters if you want to match them verbatim. Supported conversions: - * → .* - ? → . - [ae] → [ae] - [^e] → [^e] - [a-b] → [a-b] Other regex metacharacters are properly escaped.- Parameters:
redisPattern- the Redis glob-style pattern (e.g., "h?llo*", "user:[0-9]*")- Returns:
- a valid Java regex string equivalent to the Redis pattern.
-