Fix regex pattern matching in puppet mode