Closed ojg-git closed 1 year ago
No worries, I've done that more times than I can count! 😁
I've updated the regex to the new one, it should be live in a few minutes. I'll be traveling for a few weeks without my PC starting tomorrow, so if you find any more issues I would greatly appriciate a PR (since I can merge and deploy from my phone).
The code for generating the regex is a bit messy but you can find it at: https://github.com/veiset/poe-vendor-string/blob/master/src/utils/OutputString.ts#L134
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
Originally posted by @ojg-git in https://github.com/veiset/poe-vendor-string/issues/74#issuecomment-1599199997