Loading...
 
Example of a Tcl switch using regular expressions to match file extentions. The leading '***:(?i)' is to enable advanced regular expressions (ARE), in case insensitive mode.


 switch -regexp -- $file {
       ***:(?i).*\.ids     {set type ICS}
       ***:(?i).*\.ics     {set type ICS}
       ***:(?i).*\.tif.?   {set type TIFF}
       default             {set type UNKOWN}
}