Added support for rules like CN > $2$G1 where which uses backreferences and indices on variables.