Are you asking a question? :)

You can also use this probably: a.match("(?i)^$b\$")
(I didn't test.)

If you had access to the code, you could write a simple virtual method to do it 
like so:
a.equals_ignore_case(b)

or a function that works the same way as your macro

Phil Mitchell wrote:
There's probably an easy way to do this, but :) ... what I did was
create a macro (in my global macros.tt file):

[% MACRO equals_ignore_case_(a, b)
   BLOCK;
      a = a | upper;
      b = b | upper;
      a == b;
   END;
 %]

This works when I call it from within the macros file, but not from
elsewhere. In other words, this test works sometimes and not others:

[% a = 'test' %]
[% b = 'TEST' %]
[% IF equals_ignore_case_(a,b) %]
   MATCHES
[% ELSE %]
   DOESN'T MATCH
[% END %]


_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to