String Capture

This can probably be achieved with Regex but more information is needed. If you want to learn regex yourself or formulate your question more so that an answer can be provided I suggest examining this link: