We can't tell you exactly how to do it, because we haven't got any access to the actual string, and that going to be fundamental to what you need to do. Without the actual data, it's not possible to design any code that will 100% grab exactly what you need and nothing else - even with it, you probably need a good number of samples to work form to be sure that you are correctly isolating just the right information each time.
So start with your data, and look for the bit you want. Look to see if there is anything around it - preferably before
and after that uniquely says "get this bit" and that isn't repeated anywhere that you don't get what you want.
Then consider looking at a Regular Expression (exactly how you use them depends on you development system / the environment the code will run in) and see if you can use one to isolate just the IP address. A basic IP address match in a regex would look like this:
\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}
But you may need to expand that depending on the rest of your data, as that will match any sequence of up to three digits separated by dots.
As a helper, get a copy of
Expresso[
^] - it's free, and it examines and generates Regular expressions.