Closed ojg-git closed 1 year ago
Hey, this is a really good suggestion. Thanks for the great explanation and reasoning behind this, I've replaced the current RGB regex with your suggestion.
Of course you would commit this and I would immediately find another use case that didn't work. š
Fortunately, the use case is relatively specific and won't matter in most cases, but the hyper-specific cases that don't work are as follows:
The regex will identify this as a match because we found 2 linked colors and then our final color in the 2nd group prefaced by a - (our link indicator).
The correction for this would unfortunately add characters, though, i'm not sure if that's really an issue since it's still within the accepted max regex characters for PoE:
replace the ".-" described in 3 of the original post with the more specific "(-.)-"
The full corrected regex would be the following: ([^w])-(?!\1|w)(.)(-.)*-(?!\1|\2|w)(.)
This makes it 38 characters instead of 35 like the original, but it's already a long one and i'm unsure if anyone uses it in combination with anything else anyway, though I can see where just 3 additional characters could pose an issue if someone is looking for something hyper-specific.
Sorry about any problems I may have caused for you >.< -oj
The search function for 3L RGB does not find all equipment with at least 1 red, 1 blue, and 1 green socket all linked. For example: Search text: R-G-B will not find equipment with linked socket group: R-G-G-B, or any iteration with multiple greens between the red and blue socket.
Regex for the correction (also 35 characters, same character count as the current search for RGB socket groups): ([^w])-(?!\1|w)(.).*-(?!\1|\2|w)(.)
this works because: 1, Abyss and Delve sockets are never linked, so we are only concerned with linked white socket removal. 2, any RGB socket is found, we check for a linked socket connected of a different color, if not found RGB does not exist. 3, after we find two linked, different-color sockets, .* gives us all characters returnable to the point we find another "-" with our final color. 4, substring exists T/F, normal regex processing and returns.
Tested with a few linked and non-linked RGB sockets as well as non-RGB socketed equipment and encountered no issues.