in reply to String Manipulation Help Required

The first thing I see here is that when matching whitespace in regexps use '\s' instead of ' '.

For example: \<product\s+ to match the start of the product tag.

One world, one people