Catman..._match(3pm)

πŸ“¦
version 1.320 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

okay so bestie, welcome to Catman..._match(3pm) β€” she's part of the User Contributed Perl Documentation collection and she's here to serve.

Catmandu::Fix::Condition::marc_match β€” literally just: test if a MARC (sub)field matches a value. that's it. that's the whole gig. πŸŽ€


✨ SYNOPSIS ✨

no cap, here's how she shows up in the wild:

# 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

🌸 DESCRIPTION 🌸

so the vibe is: your enclosing fixes only get evaluated if the MARC (sub)field matches a regular expression. πŸ¦‹

and when the MARC field is a repeated field? then all of the MARC fields have to match the regular expression. every single one. she's thorough like that. πŸ‘‘

πŸ’€ DEPRECATED: bestie I have to be honest with you β€” this condition is the same as Catmandu::Fix::Condition::marc_all_match and it will be deleted in the future. it's giving "on borrowed time". plan accordingly. 😭

πŸŽ€ METHODS πŸŽ€

πŸ’… marc_match(MARC_PATH, REGEX)

evaluates to true when all MARC_PATH values match the REGEX, and false otherwise. that's the whole method, she's simple, she's iconic, she ate. ✨


πŸ‘€ SEE ALSO πŸ‘€

go give her siblings some love too, they're all in the family:

  • Catmandu::Fix::Condition::marc_all_match
  • Catmandu::Fix::Condition::marc_any_match

okay that's the whole page bestie, you're so welcome 🫢

this was documented under perl v5.38.2 and dated 2024-08-03 β€” like, clocked in and everything. bye mwah πŸ’œ

πŸ“¦ where this page comes from