in reply to Obtain information from a string
You will find all of the information you need here: regular expressions. Also, the m operator manpage might be useful to you.
stephen