summaryrefslogtreecommitdiffstats
path: root/test/data/snippets/ifexpression.pp
Commit message (Collapse)AuthorAgeFilesLines
* Fix #2033 - Allow regexp in if expressionBrice Figureau2009-08-011-0/+12
This changeset introduces regexp in if expression with the use of the =~ (match) and !~ (not match) operator. Usage: if $uname =~ /Linux|Debian/ { ... } Moreover this patch creates ephemeral variables ($0 to $9) in the current scope which contains the regex captures: if $uname =~ /(Linux|Debian)/ { notice("this is a $1 system") } Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>