You can use strstr() to find a text in a text. That will give you a pointer to "name-1". Next you can move the pointer a number of positions forward to where the actual data starts and copy that using memcpy() to an other array . You will need to keep space for a terminating nul character.
On a cell phone at the moment so can't work out an example.