Your question is not very clear - when you say 'take out' the 34 and the 56, do you mean you want the result to be the remainder of the text, or given that text, you want the result to be 34 and 56?

It's probably best if you explain more clearly and provide several examples of input text and the output you would expect to get.

If you cannot describe what you are doing as a process, you don't know what you're doing...
W.E. Deming