I have product codes for example HX3923, which always start with 2 capital letters, and end with 4 numbers. Some products have "gold" color, which is somewhere in the text.
Example:
HX3923, width: 0.3, height: 0.7, gold, HX3924, color="blue", width=0.3
I need to match HX3923, but not HX3924, since the latter has no gold color.
This selects both product codes
[A-Z][A-Z]\d\d\d\d
I thought I needed to add something like
[?=gold)
But that looks directly after the product code. How can I make sure it looks if there is gold BEFORE the next product code "starts"?
Currently have this ugly solution:
[A-Z][A-Z]\d\d\d\d(?=.{0,100}gold)