I am trying to find a string between specific string and specific character OR last occurence of character, using regex.
To be more clear, I need to find the value for the word "Gamme". That value can like "value" or like "value1,value2". My problem is mainly with the comma "," because the comma can be present in the value "value1,value2" but it is also the separator between each attribute in the string.
Example :
- {Ambiance=undefined, Gamme=ADT COSY BLUE,CULINAIRE COSY BLUE}
- {Ambiance=undefined, Style=undefined, Gamme=ADT COSY BLUE}
- {Ambiance=undefined, Activité Produit=undefined, Gamme=undefined}
- {Ambiance=undefined, Gamme=ADT COSY BLUE, Style=OCEAN}
- {Ambiance=undefined, Gamme=ADT COSY BLUE,CULINAIRE COSY BLUE, Product=185427}
For now the best I could do is : (?<=Gamme=)(.*?)(?=[\=])|(?<=Gamme=)[^\}]+
But it does not work perfectly for my case.
Can you help me with the regex ?
Thanks !