Fix exception in snippet generator

This fixes a StringIndexOutOfBoundsException that would occur in
CamelCaseFunctionNameSanitizer for function names with multiple spaces,
that is for step definitions with more than one capture group.