---
name: "Catmandu::Fix::Condition::marc_any_match"
section: "3pm"
platform: "linux"
package: "libcatmandu-marc-perl"
version: "1.320-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Catmandu::Fix::Condition::marc_any_match"
---

# Catmandu::Fix::Condition::marc\_any\_match(3pm)

Test if a MARC (sub)field matches a value

## NAME

Catmandu::Fix::Condition::marc\_any\_match - Test if a MARC (sub)field matches a value

## SYNOPSIS

```
   # marc_any_match(MARC_PATH,REGEX)
   # Match when 245 contains the value "My funny title"
   if marc_any_match('245','My funny title')
        add_field('my.funny.title','true')
   end
   # Match when 245a contains the value "My funny title"
   if marc_any_match('245a','My funny title')
        add_field('my.funny.title','true')
   end
   # Match when at least one 650 field contains digits
   if marc_any_match('650','[0-9]')
     add_field('has_digits','true')
   end
```

## DESCRIPTION

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

## METHODS

### marc\_any\_match(MARC\_PATH, REGEX)

Evaluates to true when at least one MARC\_PATH values matches the REGEX, false otherwise.

## SEE ALSO

Catmandu::Fix::Condition::marc\_all\_match
