Add unit test for collect rules. references #2695
Add possibility to use regex result in action of collect rules. closes #2695