One hint when working with regular expressions, if you use curly brackets instead of quotes, you don't have to bother with escaping the string from the tcl parser.. As for your pattern, I find it somewhat overworked. If you merely would like to match either a, b, or cd, this would suffice: set m {^...