Arcitectus / Sanderling

APIs and libraries to read information directly from the EVE Online game client.
https://forum.botlab.org
Apache License 2.0
259 stars 117 forks source link

IsMinerSetIndicatorLabelRegexPattern has improper regex #38

Closed abador closed 6 years ago

abador commented 6 years ago

Try to use a "Mining Laser Upgrade". The regex should have a negative clause for the word Upgrade. I think this should do the trick: "Mining\s*Laser\s(?!Upgrade)"

Viir commented 6 years ago

Thank you for the feedback and the suggestion of a pattern code. I played around with the pattern Mining\s*Laser\s(?!Upgrade) on http://regexstorm.net/tester I found this pattern would not match the input of Mining Laser. Is this intended?

Viir commented 6 years ago

Do you see a downside to using a pattern which would match Mining Laser too?

abador commented 6 years ago

@Viir Sorry, I was out for a bit. That was unintended. I think the best way would be to change the first regex to "Mining\sLaser$" (you find everything that ends with "Minign Laser"), and add the previous one "Mining\sLaser\s(?!Upgrade)" to negate everything that is an upgrade

Viir commented 6 years ago

I think the best way would be to change the first regex to "Mining\sLaser$" (you find everything that ends with "Minign Laser"), and add the previous one "Mining\sLaser\s(?!Upgrade)" to negate everything that is an upgrade

Nice! I see no problem so far with these patterns and I think it can be implemented just like this.

Viir commented 6 years ago

I adapted the code accordingly with commit 70ce068d1672896a3a9b6aa4f0bc3f1a2d05f0bb.