On Tue, Apr 5, 2011 at 3:48 PM, Jacob Helwig <
ja...@puppetlabs.com> wrote:
> On Tue, 05 Apr 2011 15:24:12 -0700, Jeffrey wrote:
>>
>> Hi folks,
>>
>> Does anyone know how to do case-insensitive regex in a puppet
>> manifest? I tried obvious things, like adding an 'i' at the end of my
>> regex (ala perl) but that didn't work.
>>
>> if ($operatingsystem =~ /(centos|redhat|oel)/) {
>> ...
>> }
>>
>> The following works (for centos), but it's a bit clunky,
>>
>> if ($operatingsystem =~ /([Cc][Ee][Nn][Tt][Oo][Ss]|redhat|oel)/) {
>> ...
>> }
>>
>> For completion, I found the 'downcasefacts' directive in puppet.conf,
>> but that's not really what I want. (Plus, 'downcasefacts' is
>> deprecated anyway.)
>>
>
> After talking with Nick Lewis, we suspect that the following will work:
>
> if ($operatingsystem =~ /((?i:centos)|redhat|oel)/) {
> ...
> }