Skip to content

Commit fcd5934

Browse files
committed
improve(series import): extract year when it ends with a dot.
Fix #1312
1 parent 228931c commit fcd5934

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class SeriesInfoExtractorServiceImpl implements SeriesInfoExtractorServic
5656
// Year should be in range within 1840 and 2099 inclusive.
5757
// CheckStyle: ignore LineLength for next 2 lines
5858
private static final Pattern RELEASE_DATE_REGEXP =
59-
Pattern.compile("((?<day>[0-9]{2})\\.(?<month>[0-9]{2})\\.)?(?<year>18[4-9][0-9]|19[0-9]{2}|20[0-9]{2})(г(од|\\.)?)?");
59+
Pattern.compile("((?<day>[0-9]{2})\\.(?<month>[0-9]{2})\\.)?(?<year>18[4-9][0-9]|19[0-9]{2}|20[0-9]{2})(г(од|\\.)?|\\.)?");
6060

6161
// Regular expression matches number of the stamps in a series (from 1 to 999).
6262
// CheckStyle: ignore LineLength for next 2 lines

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ class SeriesInfoExtractorServiceImplTest extends Specification {
288288
'2010\t\tbrazil' | _
289289
'2010 brazil' | _
290290
'prehistoric animals 2010 congo' | _
291+
'2010.' | _
291292
'2010г' | _
292293
'2010г.' | _
293294
'2010год' | _

0 commit comments

Comments
 (0)