[libcatmandu-marc-perl] 182/208: Replacing \d with explicit ascii [0-9]
Jonas Smedegaard
dr at jones.dk
Sat Oct 28 03:42:48 UTC 2017
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag upstream/1.19
in repository libcatmandu-marc-perl.
commit 30aaa4a110391c601bf45cef684f97c709a3a26a
Author: Patrick Hochstenbach <patrick.hochstenbach at ugent.be>
Date: Mon Jul 10 08:53:37 2017 +0200
Replacing \d with explicit ascii [0-9]
---
Build.PL | 2 +-
lib/Catmandu/Fix/Condition/marc_has_many.pm | 2 +-
lib/Catmandu/Fix/marc_map.pm | 2 +-
lib/Catmandu/Fix/marc_spec.pm | 2 +-
lib/Catmandu/Importer/MARC/Decoder.pm | 2 +-
lib/Catmandu/Importer/MARC/ISO.pm | 2 +-
lib/Catmandu/MARC.pm | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/Build.PL b/Build.PL
index a929a05..0b2b478 100644
--- a/Build.PL
+++ b/Build.PL
@@ -1,5 +1,5 @@
-# This file was automatically generated by Dist::Zilla::Plugin::ModuleBuild v6.008.
+# This file was automatically generated by Dist::Zilla::Plugin::ModuleBuild v6.005.
use strict;
use warnings;
diff --git a/lib/Catmandu/Fix/Condition/marc_has_many.pm b/lib/Catmandu/Fix/Condition/marc_has_many.pm
index 6de381f..97b5fc9 100644
--- a/lib/Catmandu/Fix/Condition/marc_has_many.pm
+++ b/lib/Catmandu/Fix/Condition/marc_has_many.pm
@@ -28,7 +28,7 @@ sub emit {
$perl .= $marc_map->emit($fixer,$label);
my $all_match =
- $self->marc_path =~ m{^...(\/\d+-\d+)?$} ?
+ $self->marc_path =~ m{^...(\/[0-9]+-[0-9]+)?$} ?
Catmandu::Fix::Condition::exists->new("$tmp_var.1") :
Catmandu::Fix::Condition::exists->new("$tmp_var.0.1");
diff --git a/lib/Catmandu/Fix/marc_map.pm b/lib/Catmandu/Fix/marc_map.pm
index 2149f2d..eb1dc3e 100644
--- a/lib/Catmandu/Fix/marc_map.pm
+++ b/lib/Catmandu/Fix/marc_map.pm
@@ -33,7 +33,7 @@ sub emit {
'-pluck' => $self->pluck // 0 ,
'-nested_arrays' => $self->nested_arrays // 0 ,
'-value' => $self->value ,
- '-force_array' => ($key =~ /^(\$.*|\d+)$/) ? 1 : 0
+ '-force_array' => ($key =~ /^(\$.*|[0-9]+)$/) ? 1 : 0
});
my $var = $fixer->var;
diff --git a/lib/Catmandu/Fix/marc_spec.pm b/lib/Catmandu/Fix/marc_spec.pm
index a0dccba..d2d3754 100644
--- a/lib/Catmandu/Fix/marc_spec.pm
+++ b/lib/Catmandu/Fix/marc_spec.pm
@@ -35,7 +35,7 @@ sub emit {
'-nested_arrays' => $self->nested_arrays // 0 ,
'-invert' => $self->invert // 0 ,
'-value' => $self->value ,
- '-force_array' => ($key =~ /^(\$.*|\d+)$/) ? 1 : 0
+ '-force_array' => ($key =~ /^(\$.*|[0-9]+)$/) ? 1 : 0
});
my $var = $fixer->var;
diff --git a/lib/Catmandu/Importer/MARC/Decoder.pm b/lib/Catmandu/Importer/MARC/Decoder.pm
index ad23a49..a987cc8 100644
--- a/lib/Catmandu/Importer/MARC/Decoder.pm
+++ b/lib/Catmandu/Importer/MARC/Decoder.pm
@@ -48,7 +48,7 @@ sub decode {
if ($id =~ /^00/ && $record->field($id)) {
$sysid = $record->field($id)->data();
}
- elsif ($id =~ /^(\d{3})([\da-zA-Z])$/) {
+ elsif ($id =~ /^([0-9]{3})([[0-9a-zA-Z])$/) {
my $field = $record->field($1);
$sysid = $field->subfield($2) if ($field);
}
diff --git a/lib/Catmandu/Importer/MARC/ISO.pm b/lib/Catmandu/Importer/MARC/ISO.pm
index fe6d87e..6bb2dff 100644
--- a/lib/Catmandu/Importer/MARC/ISO.pm
+++ b/lib/Catmandu/Importer/MARC/ISO.pm
@@ -125,7 +125,7 @@ sub decode_marc {
if ($id =~ /^00/ && $record->field($id)) {
$sysid = $record->field($id)->data();
}
- elsif ($id =~ /^(\d{3})([\da-zA-Z])$/) {
+ elsif ($id =~ /^([0-9]{3})([0-9a-zA-Z])$/) {
my $field = $record->field($1);
$sysid = $field->subfield($2) if ($field);
}
diff --git a/lib/Catmandu/MARC.pm b/lib/Catmandu/MARC.pm
index 798bb69..2693c8d 100644
--- a/lib/Catmandu/MARC.pm
+++ b/lib/Catmandu/MARC.pm
@@ -983,7 +983,7 @@ sub compile_marc_path {
my ($field,$field_regex,$ind1,$ind2,
$subfield,$subfield_regex,$from,$to,$len,$is_regex_field);
- my $MARC_PATH_REGEX = qr/(\S{1,3})(\[([^,])?,?([^,])?\])?([\$_a-z0-9^]+)?(\/(\d+)(-(\d+))?)?/;
+ my $MARC_PATH_REGEX = qr/(\S{1,3})(\[([^,])?,?([^,])?\])?([\$_a-z0-9^]+)?(\/([0-9]+)(-([0-9]+))?)?/;
if ($marc_path =~ $MARC_PATH_REGEX) {
$field = $1;
$ind1 = $3;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcatmandu-marc-perl.git
More information about the Pkg-perl-cvs-commits
mailing list