Open tadwohlrapp opened 1 year ago
Updating the regex itself is not the real issue (/(\d+ ?%).*?\((\d+)/
would work just fine), but currently the percentage gets stored as a string containing the percentage sign itself.
Simply adding a ?
to the space between the number and the percentage sign to make it optional would result in a mix of stored 90 %
and 90%
scores.
Rather the %
should be omitted completely from storage and only added when rendering the scores.
We will need a solution which doesn't break already stored values.
Problem description
Example of familiar rating text:
https://www.amazon.de/sp?seller=A2N0PAQ62QEUZ
New text discovered today:
https://www.amazon.de/sp?seller=A3VZ5OB3NSI4Z8
Current regex to extract positive rating percentage and number of ratings on amazon.de:
/(\d+ %).*?\((\d+)/
For the above example the regex captures
95 % positive Bewertungen in den letzten 12 Monaten (154
with the two groups95 %
and154
.Seems like it should be extended to also capture text like
100% positiv Lebensdauer (4 Gesamtbewertungen)
(which by the way reads very weird in German...)Amazon Link
https://www.amazon.de/sp?seller=A3VZ5OB3NSI4Z8
SoldBy Version
1.7.1
Browser
Brave
Userscript manager
Violentmonkey