Added ability to specify capture group name and check group number