I try to capture all information in a string but only the last one is captured. I start with regex and i need some help.
The string :
correspondent à l'ASIN B00WU8XXXX, mais les attributs suivants sont en conflit avec : product_type (Vendeur : 'APPLIANCE_ACCESSORY' / Amazon : 'CLEANING_AGENT'), ean (Vendeur : '400650819XXXX' / Amazon : '400650819XXXX'), item_package_quantity (Vendeur : '5' / Amazon : '10'
My regex :
.* (.*?) \(Vendeur : \'(.*?)\' \/ Amazon : \'(.*?)\'
I capture only the last block
item_package_quantity : 5 : 10
That i want to capture :
product_type : APPLIANCE_ACCESSORY : CLEANING_AGENT
ean : 400650819XXXX: 400650819XXXX
item_package_quantity : 5 : 10
It must be nothing but i turn around :(
You could start the pattern with the group 1 match for 1 or more word characters
(\w+)and use a negated character class[^']*for the values inside the single quotes.Depending on the delimiter you have to escape the
\/Regex demo | PHP demo
Output