I need a regular expression that can capture the data from a description like this:
14Kt Yellow Gold Mothers Ring Style 152, Genuine Amethyst,Genuine Diamond,Simulated Emerald,Premium Topaz,Premium Tourmaline,Genuine Sapphire, Engravings: jim,jake,john,jeff,rob,sandy, Band Engraving: smith
What I need to capture is:
A) style (Style 152) (style + any number)
B) gold (14Kt Yellow Gold) (can be combinations of 14kt, 10kt, yellow, or white)
C) stones (Genuine Amethyst,Genuine Diamond,Simulated Emerald,Premium Topaz,Premium Tourmaline,Genuine Sapphire) (this can change in how many but always at least 1)
D) engravings (jim,jake,john,jeff,rob,sandy) (this can be 0 or more and the string Engravings: wont be there if there is no names)
E) band engraving (smith) (this is also optional and the string Band Engraving: wont be there if there is no name either)
I have been working with regular epressions for a few months now but this is a little over my head since it can very so much...this is the best one I came up woth but it doesn't ork if the string Engravings: is gone:
/(\d{2}.+gold).+(style \d+)(.+)engravings:([^\*]*)(\*)?(.*)/i
THANKS!