unit testing for nested regex objects