This is a followup question to a couple of older threads. I’ve managed to get the following code from this thread working:
if($ReferenceRIS.contains("Z1 -")){
$ReferenceRIS.contains("Z1 - ([^\n]*)\n");
$CiteKey=$1.replace("Z1 - ","").replace("\n","")
}
else {$CiteKey=""};
But if I then amend the rule as follows:
if($ReferenceRIS.contains("Z1 -")){
$ReferenceRIS.contains("Z1 - ([^\n]*)\n");
$CiteKey=$1.replace("Z1 - ","").replace("\n","")
}
else {$CiteKey=""};
if($ReferenceRIS.contains("Z2 -")){
$ReferenceRIS.contains("Z2 - ([^\n]*)\n");
$ReferenceURL=$2.replace("Z2 - ","").replace("\n","")}
else {$ReferenceURL=""}
Then ReferenceURL ends up with the contents of the Z1 field, not the Z2 field. I guess I should be using something other than $2 to get the contents of the regex match, but I have no idea what to use?