Browse Source

Added regex handler to Condition

Alois Mahdal (@azzgoat) 11 years ago
parent
commit
2d0d16bd27
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      lib/SugarTrail/Template/Condition.pm

+ 6
- 0
lib/SugarTrail/Template/Condition.pm View File

@@ -13,6 +13,12 @@ sub _equals {
13 13
     return $a eq $b;
14 14
 }
15 15
 
16
+sub _regex {
17
+    my $a = shift;
18
+    my $b = $_[0]->[0];
19
+    return $a =~ m/$b/;
20
+}
21
+
16 22
 sub new {
17 23
     my $class   = shift;
18 24
     my $self    = {};