Fix regex on keys and avoid re on int query