Yep, agreed. I would actually suggest using single quotes instead of double
when doing regexp. You'll save yourself a lot of trouble that way.
-- Josh
Mihai Bazon wrote:
> Perhaps you should try to backslash the $ sign in the regexp? (since
> it's given in a double-quoted string). Just guessing...
>
> -M.
>
> ---------- Original Message ----------
> From: Chris Travers <[EMAIL PROTECTED]>
> Date: Mon, Nov 10, 2008 / 7:24pm GMT
>
> <% my_test = [1000];
> IF my_test.grep("^1$").size %>TEST <% END %>
>
> For some reason, the test is returning true.
>
> <% my_test = [1000];
> IF my_test.grep("^2$").size %>TEST <% END %>
>
> Returns false.
>
> <% my_test = [1000];
> IF my_test.grep("^0$").size %>TEST <% END %>
>
> I would have expected the grep to match if any element in the list was
> exactly a value of "1" but instead it seems to ignore the end of line
> character.
>
> Any idea why?
>
> Best Wishes,
> Chris Travers
>
> _______________________________________________
> templates mailing list
> [email protected] <mailto:[email protected]>
> http://mail.template-toolkit.org/mailman/listinfo/templates
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> templates mailing list
> [email protected]
> http://mail.template-toolkit.org/mailman/listinfo/templates
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates