You can iterate over all of your keys and check if they match the regular expression. This may not be the most effective way to do this, but this is the first thing I thought about. Here's what it looks like:
Pattern p = Pattern.compile("*someName*");
List<String> matchingKeys = new ArrayList<>();
for (String key : map.keySet()) {
if(p.matcher(key).matches()) {
matchingKeys.add(key);
}
}
: map :
HashMap<String, SomeValueClass> map = new HashMap<>();