When you submit a feed of products to Amazon it will return a error report that will contain suggestions for products that were not matched, like so:
18 998 8042 Error "SKU '998'ASIN B0001FSZ6K 'item_name' Merchant value: 'Promax Nutrition Promax Bar - Mocha Blast' Amazon catalog value: 'Promax Bars, Mocha Blast 12 bars'. ASIN B00024D3HQ 'manufacturer' Merchant value: 'Promax Nutrition' Amazon catalog value: 'PROMAX' 'item_name' Merchant value: 'Promax Nutrition Promax Bar - Mocha Blast' Amazon catalog value: 'Promax Gourmet Bar Mocha Blast 12 bars'."
In this example "Merchant value:" is what was submitted and "Amazon catalog value:" is a close match.
I'm trying to extract these values so we can adjust our feed submission and resend the erroneous items. I've hacked together this regex:
(Merchant value\:) (')(.+?)(')( Amazon catalog value\: )(')(.+?)(ASIN)
This almost works. I can pull group 3 and 7 and have my values... sometimes. Unfortunately some of the suggestions look like:
Merchant value: 'Barleans' Amazon catalog value: 'Barlean's Organic Oils'
So the tick will break the match. I assume I can change the end match to "' " and ignore the "'s", but i'm not sure if my regex is at all efficient and I know it's prone to breaking on the corner cases.
Edit to clarify:
The data I'm trying to get would be:
SKU (998 in the first example) then for each suggestion: Field (itemname or manufacturer) Our Value Amazon's Suggested Value
So it would be like:
998 | itemname | Promax Nutrition Promax Bar - Mocha Blast | Promax Bars, Mocha Blast 12 bars