Skip to content

Commit

Permalink
Replacing \d with explicit ascii [0-9]
Browse files Browse the repository at this point in the history
  • Loading branch information
phochste committed Jul 10, 2017
1 parent 0f21801 commit 30aaa4a
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Build.PL
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
2 changes: 1 addition & 1 deletion lib/Catmandu/Fix/Condition/marc_has_many.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
2 changes: 1 addition & 1 deletion lib/Catmandu/Fix/marc_map.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/Catmandu/Fix/marc_spec.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/Catmandu/Importer/MARC/Decoder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Catmandu/Importer/MARC/ISO.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Catmandu/MARC.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 30aaa4a

Please sign in to comment.