Catmandu::Fix::Condition::marc_match(3pm)

Catmandu::Fix::Condition::marc_match3pm

Test if a marc (sub)field matches a value

Usage

   # marc_match(MARC_PATH,REGEX)
   # Match when 245 contains the value "My funny title"
   if marc_match('245','My funny title')
        add_field('my.funny.title','true')
   end
   # Match when 245a contains the value "My funny title"
   if marc_match('245a','My funny title')
        add_field('my.funny.title','true')
   end
   # Match when all 650 fields contain digits
   if marc_match('650','[0-9]')
     add_field('has_digits','true')
   end
   # Match when /one/ of the 650 fields contain digits
   do marc_each()
      if marc_all_match('650','[0-9]')
        add_field('has_digits','true')
      end
   end

Overview

Evaluate the enclosing fixes only if the MARC (sub)field matches a regular expression. When the MARC field is a repeated fiels, then all the MARC fields should match the regular expression.

DEPRECATED: This condition is the same as Catmandu::Fix::Condition::marc_all_match and will be deleted in the future

Methods

marc_match(MARC_PATH, REGEX)

Evaluates to true when all MARC_PATH values matches the REGEX, false otherwise.

Releases

6 releases since Debian 8 (Jessie); the text changed 4 times.

  1. 8
  2. 9
  3. 10–11
  4. 12
  5. 13

From libcatmandu-marc-perl 1.320-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.