Maybe the dash in -%> is the problem, I was tunnel visioned on the regex part.
On Fri, Mar 5, 2010 at 6:58 AM, Len Rugen <lenru...@gmail.com> wrote: > But they don't seem to work IN A TEMPLATE.... > > On Fri, Mar 5, 2010 at 1:16 AM, Peter Meier <peter.me...@immerda.ch>wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> > So can someone point to working regex template example? >> >> First answer of Ohad to your question: >> >> > you might want to try regexp, e.g. >> > >> > <% if fqdn =~ /^something/ -%> >> >> >> irb(main):001:0> "aaaa" =~ /^aa/ >> => 0 >> irb(main):002:0> "aaaa" =~ /^ab/ >> => nil >> >> =~ returns the first location of the occurence of the pattern or nil if >> none is found. if nil in ruby will never be evaluated. >> >> cheers pete >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkuQr9sACgkQbwltcAfKi39wRgCeJtTVbOFcRC4I3TWQFm2YTWOk >> mskAni20CwM2zvqarbhyKcQNC9cznNAL >> =mAAm >> -----END PGP SIGNATURE----- >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Puppet Users" group. >> To post to this group, send email to puppet-us...@googlegroups.com. >> To unsubscribe from this group, send email to >> puppet-users+unsubscr...@googlegroups.com<puppet-users%2bunsubscr...@googlegroups.com> >> . >> For more options, visit this group at >> http://groups.google.com/group/puppet-users?hl=en. >> >> > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.