echo begin

case foo {
    foo { echo foo }
}

set X = foobar
echo $X

case $X {
    foo {
        echo is foo
    }
    bar {
        echo is bar
    }
    foo.* {
        echo begins with foo
    }
}

case $X {
    .* {
        echo wildcard
    }
    foo.* {
        echo begins with foo
    }
}

case $X {
    .*bar {
        echo ends with bar
    }
    .* {
        echo wildcard
    }
}

echo end