i have a String “Iphone XR 128GB Blue - IPXR128BLU (Out of Stock) | Iphone XR 128GB Blue - IPXR128BLU (Out of Stock)” and from this i want to extract devicename-IPXR, Memory-18 and Color"BLU".
String can also be like : “APPLE IPAD 32GB GREY refurb -IPD5L32GRYRFB”
and from this also device name,memory and color needs to be extracted
You need to define good rules for the extraction to work.
First you need to locate the code that contains those parts “IPXR128BLU”. Is it always the first word after the “-”? If yes, that’s your rule. Then, having the code, I guess it would be easy to find the memory, as this is usually one of the values 16, 32, 64, 128, 256 or 512. Then, the first part should be considered the device name and whatever is after the color?