Working with text

Is there a way in actionscript to search through a block of text and extract certain sentences for example or pieces of information that match a certain criteria.

What im thinking of doing is loading in some data from an XML file and searching through to see if it contains a link and/or an URL

any ideas?