If the variable should match with style_1 it drops to default. Any suggestions?
Here is a sample:
set style_1 {^[0-9]$}
foreach phone $List {
switch -regexp — $phone {
$style_1 {
echo “Style 1 found”
}
^[0-9][0-9]$ {
echo “Style 2 found”
}
^[0-9][0-9][0-9]$ {
echo “Style 3 found”
}
^[0-9][0-9][0-9][0-9]$ {
echo “Style 4 found”
}
^[0-9][0-9][0-9][0-9][0-9]$ {
echo “Style 5 found”
}
default {
echo “Style default found”
}
}
}