> > $pp_shortcertname= "${trusted['certname']}".match(/([^.]+)\./)[1] > > not sure I fully understand why this works and [] doesn't. > > Not 100% sure I understand what the [1] does ! >
The parentheses are for capturing the matching text, and \1 for re-using it as a backreference; [1] outside of the pattern. See http://ruby-doc.org/core-2.1.1/Regexp.html#class-Regexp-label-Capturing Rp -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CANwwCtyieAPNoonp4KN_nVd76MdW3h0A8s9%3DNPo_0QdobFoeRA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.