Rachellim,
On the surface, this doesn't appear to be too difficult a task. In general, I use regular expressions for matching operations. Regular expressions are quite powerful. Because they are so powerful, they are also somewhat complex. You might start by checking out the following link:
http://msdn2.microsoft.com/en-us/library/hs600312.aspx
If you have further, specific questions, I'll be happy to assist.
Cheers.
- Roger Nedel