Check out [match and [URL="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/exec"]exec](https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/match). Give it a go and if you encounter problems post what you attempted.