Skip to content

Commit

Permalink
Specify length of regex
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasNx committed Nov 28, 2024
1 parent 2a89177 commit 8ceb20d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
10 changes: 5 additions & 5 deletions src/main/resources/alma/fix/item.fix
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,16 @@ do list(path: "hasItem[]","var":"$i")
end
end

set_array("rvk[]")
set_array("@callNumberRvk[]")
do list(path:"hasItem[]","var":"$i")
if any_match("$i.callNumber","[A-Z][A-Z] \\d* .*")
copy_field("$i.callNumber","rvk[].$append")
if any_match("$i.callNumber","[A-Z][A-Z] \\d{3,6} .*")
copy_field("$i.callNumber","@callNumberRvk[].$append")
end
end

replace_all("rvk[].*","([A-Z][A-Z] \\d*) .*","$1")
replace_all("@callNumberRvk[].*","([A-Z][A-Z] \\d{3,6}) .*","$1")

do list(path:"rvk[]","var":"$i")
do list(path:"@callNumberRvk[]","var":"$i")
copy_field("$i","subject[].$append.notation")
set_array("subject[].$last.type[]","Concept")
add_field("subject[].$last.source.label","RVK (Regensburger Verbundklassifikation)")
Expand Down
7 changes: 0 additions & 7 deletions src/test/resources/alma-fix/990016782920206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,6 @@
"id" : "https://www.wikidata.org/wiki/Q47524318"
},
"label" : "Klavier / Lehrmittel"
}, {
"notation" : "NC 10",
"type" : [ "Concept" ],
"source" : {
"label" : "RVK (Regensburger Verbundklassifikation)",
"id" : "https://d-nb.info/gnd/4449787-8"
}
} ],
"subjectslabels" : [ "Klavier / Lehrmittel" ],
"hasItem" : [ {
Expand Down

0 comments on commit 8ceb20d

Please sign in to comment.