If you can figure out where the substring is located, why can't you just use the subsring method to extract it?

It might help if you gave us a few more examples of desired input and output.