I don't think regular expressions is the way to go here, if your dictionary is actually in Python.
Here's a sample of your data:
g = {
(0, False, None, 0, False, None):(False,False,True),
(0, True, fire, 0, True, fire):(1/1,1/1,1/1),
(0, True, fire, 0, True, block):(1/1,1/1,1/1),
(0, True, fire, 0, True, reload):(1/1,1/1,1/1),
(0, True, fire, 0, False, fire):(1/1,1/1,1/1),
(0, True, fire, 0, False, block):(1/1,1/1,1/1),
(0, True, fire, 0, False, reload):(1/1,1/1,1/1),
(0, True, fire, 1, True, fire):(1/1,1/1,1/1),
(0, True, fire, 1, True, block):(1/1,1/1,1/1),
(0, True, block, 2, False, reload):(1/1,1/1,1/1),
(0, True, block, 3, True, fire):(1/1,1/1,1/1),
(0, True, block, 3, True, block):(1/1,1/1,1/1),
(0, True, block, 3, True, reload):(1/1,1/1,1/1),
(6, False, reload, 6, True, reload):(1/1,1/1,1/1),
(6, False, reload, 6, False, fire):(1/1,1/1,1/1),
(6, False, reload, 6, False, block):(1/1,1/1,1/1),
(6, False, reload, 6, False, reload):(1/1,1/1,1/1),
}
And so I would use the following, since list comprehensions and generator statements have virtually replaced map and filter in Python, now, and filtering for where the second element of the keys is True
and the third element is not equal to block
:
selected_keys = [i for i in g.keys() if i[1] == True and i[2] != block]
Then you can access the dict by each key you've filtered for.
For example:
for key in selected_keys:
print(g[key])
would print the value associated with each key.