This is a correction to Bug 11046: YYY-, YY--, Y---, are also
correct according to ISBD: uncertain year, but certain decade/century
(cf. n. 4.3.8 in ISBD Consolidated Edition of 2011).
(Question mark is not mandatory.)
In addition, in Poland a form with one only dash is quite common,
like YY- (== YY--).
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
See last follow-up.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(?<year>\d)[-]?[.Xx?]{3}
|(?<year>\d{2})[.Xx?]{2}
|(?<year>\d{3})[.Xx?]
- |(?<year>\d)[-]{3}\?
- |(?<year>\d\d)[-]{2}\?
- |(?<year>\d{3})[-]\?
+ |(?<year>\d)[-]{1,3}\??
+ |(?<year>\d\d)[-]{1,2}\??
+ |(?<year>\d{3})[-]\??
/xms ) { # the form 198-? occurred in Dutch ISBD rules
my $digits = $+{year};
$retval = $digits * ( 10 ** ( 4 - length($digits) ));