Hello,

I have following code (i use dancer - so <% is [%):

<% esxiver = "51u2" %>
<% re = '(?x)
                  \b51u2\b
              ';%>
<% esxi = '51,51u2,55' %>

<% IF esxi.match(re) %>
<% esxiver %>
<% END %>

In the example I want to check the var esxi with vmethod .match() if a word "51u2" is inside. But instead of write the word fix in the re var, I want to use the var esxiver.

I try

<% re = '(?x)
                  \b\$esxiver\b
              ';%>

<% re = '(?x)
                  \b${esxiver}\b
              ';%>

<% re = '(?x)
                  \b'$esxiver'\b
              ';%>

but nothing work.

I try use the re in the match string direct:

<% IF esxi.match('\b${esxiver}\b') %>

Maybe I misunterstand the match method.

Can anyone help me, please ?

Regards

    Jochen


_______________________________________________
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to