| 1 | |||
| 2 | package UR::BoolExpr::Template::PropertyComparison::Matches; | ||
| 3 | |||
| 4 | use strict; | ||
| 5 | use warnings; | ||
| 6 | use UR; | ||
| 7 | our $VERSION = "0.46"; # UR $VERSION; | ||
| 8 | |||
| 9 | UR::Object::Type->define( | ||
| 10 | class_name => __PACKAGE__, | ||
| 11 | is => ['UR::BoolExpr::Template::PropertyComparison'], | ||
| 12 | ); | ||
| 13 | |||
| 14 | sub _compare { | ||
| 15 | my ($class,$comparison_value,@property_value) = @_; | ||
| 16 | no warnings 'uninitialized'; | ||
| 17 | foreach my $property_value ( @property_value ) { | ||
| 18 | return 1 if ( $property_value =~ m/$comparison_value/ ); | ||
| 19 | } | ||
| 20 | return ''; | ||
| 21 | } | ||
| 22 | |||
| 23 | |||
| 24 | 1; | ||
| 25 | |||
| 26 | =pod | ||
| 27 | |||
| 28 | =head1 NAME | ||
| 29 | |||
| 30 | UR::BoolExpr::Template::PropertyComparison::Matches - perform a Perl regular expression match | ||
| 31 | |||
| 32 | =head1 DESCRIPTION | ||
| 33 | |||
| 34 | If the property returns multiple values, this comparison returns true if any of the values match | ||
| 35 | |||
| 36 | =cut |