| Line 51... |
Line 51... |
| 51 |
private static final Pattern MASK_THEN_MASK =
|
51 |
private static final Pattern MASK_THEN_MASK =
|
| 52 |
Pattern.compile("(" + MASK + "\\d+" + MASK + ")(?=" + MASK + ")");
|
52 |
Pattern.compile("(" + MASK + "\\d+" + MASK + ")(?=" + MASK + ")");
|
| 53 |
private static final Pattern SPLIT = Pattern.compile(
|
53 |
private static final Pattern SPLIT = Pattern.compile(
|
| 54 |
"\\s*(?:,|/|&(?!\\s*(?:ENCO|BUBBLE|ACCESS|EXT))|\\bAND\\b)\\s*",
|
54 |
"\\s*(?:,|/|&(?!\\s*(?:ENCO|BUBBLE|ACCESS|EXT))|\\bAND\\b)\\s*",
|
| 55 |
Pattern.CASE_INSENSITIVE);
|
55 |
Pattern.CASE_INSENSITIVE);
|
| - |
|
56 |
/**
|
| - |
|
57 |
* A part that is ONLY a memory spec, so it inherits the preceding model name -
|
| - |
|
58 |
* Oppo writes "RENO 15 PRO 256GB, 512GB" and the second part is not a product.
|
| - |
|
59 |
*
|
| - |
|
60 |
* The leading \d is what makes it a memory spec rather than anything that merely
|
| - |
|
61 |
* contains G/T and digits. Without it the optional unit group matched the FIRST
|
| - |
|
62 |
* letter of a model name and the rest fell through the trailing character class,
|
| - |
|
63 |
* so "G06, G37, G37 Power" inherited its way to "G06 G37" - two Motorola phones
|
| - |
|
64 |
* fused into one entity that matches no SKU, costing G37 its cashback on five
|
| - |
|
65 |
* offers. Realme "GT 7" matches the same way and survives only because it never
|
| - |
|
66 |
* follows a comma. Same root cause as the \b guards on CAPACITY and MEMORY_PAIR:
|
| - |
|
67 |
* a digit glued to letters belongs to the model name.
|
| - |
|
68 |
*/
|
| 56 |
private static final Pattern VARIANT_ONLY =
|
69 |
private static final Pattern VARIANT_ONLY =
|
| 57 |
Pattern.compile("^[\\d\\s+/]*(?:GB|TB|G|T)?[\\d\\s+/GBT]*$", Pattern.CASE_INSENSITIVE);
|
70 |
Pattern.compile("^[\\d\\s+/]*\\d[\\d\\s+/]*(?:GB|TB|G|T)?[\\d\\s+/GBT]*$",
|
| - |
|
71 |
Pattern.CASE_INSENSITIVE);
|
| 58 |
private static final Pattern STORE_PROSE = Pattern.compile(
|
72 |
private static final Pattern STORE_PROSE = Pattern.compile(
|
| 59 |
"\\(?\\s*(offer applicable on all stores except|only for)\\b.*$",
|
73 |
"\\(?\\s*(offer applicable on all stores except|only for)\\b.*$",
|
| 60 |
Pattern.CASE_INSENSITIVE);
|
74 |
Pattern.CASE_INSENSITIVE);
|
| 61 |
private static final Pattern TRAILING_PAIR = Pattern.compile(
|
75 |
private static final Pattern TRAILING_PAIR = Pattern.compile(
|
| 62 |
"\\s*\\(?\\s*\\d+\\s*[+/]\\s*\\d+\\s*(?:GB|TB|G|T)?\\s*\\)?\\s*$",
|
76 |
"\\s*\\(?\\s*\\d+\\s*[+/]\\s*\\d+\\s*(?:GB|TB|G|T)?\\s*\\)?\\s*$",
|