Skip to content

Commit b0e772b

Browse files
committed
fix(series import): don't treat the last digit of a year as a quantity.
Part of #1376
1 parent aeb9022 commit b0e772b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/main/java/ru/mystamps/web/feature/series/importing/SeriesInfoExtractorServiceImpl.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ public class SeriesInfoExtractorServiceImpl implements SeriesInfoExtractorServic
6060
private static final Pattern RELEASE_DATE_REGEXP =
6161
Pattern.compile("((?<day>[0-9]{2})\\.(?<month>[0-9]{2})\\.)?(?<year>18[4-9][0-9]|19[0-9]{2}|20[0-9]{2})(г(од|\\.)?|\\.)?");
6262

63-
// Regular expression matches number of the stamps in a series (from 1 to 999).
63+
// Regular expression matches number of the stamps in a series.
6464
// CheckStyle: ignore LineLength for next 2 lines
6565
private static final Pattern NUMBER_OF_STAMPS_REGEXP = Pattern.compile(
66-
"(?<quantity>[1-9][0-9]{0,2})(-?(ти|ой|ух))?( ((без)?зубцов(ая|ы[ех])))?(м\\*{0,2}| (мар(ок|к[аи])|(люкс[- ])?блок(а|ов)?|БЛ))",
66+
"(?<quantity>[1-9][0-9]*)(-?(ти|ой|ух))?( ((без)?зубцов(ая|ы[ех])))?(м\\*{0,2}| (мар(ок|к[аи])|(люкс[- ])?блок(а|ов)?|БЛ))",
6767
Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE
6868
);
6969

src/test/groovy/ru/mystamps/web/feature/series/importing/SeriesInfoExtractorServiceImplTest.groovy

+1
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ class SeriesInfoExtractorServiceImplTest extends Specification {
394394
fragment | _
395395
'2 чего-либо' | _
396396
'0 марок' | _
397+
'Велоцираптор 2003 Блок с/з' | _
397398
(SeriesValidation.MAX_STAMPS_IN_SERIES + 1) + ' марок' | _
398399
}
399400

0 commit comments

Comments
 (0)