I think the only problem (for your situation) with Keith’s solution is that it is not anchored to the beginning and end of the line (by using “^” and “$” respectively). Just for kicks, here is my try at a solution:
Code:
if {[regexp — {^[AV]?d{6}$} [lindex $xlateInVals 0] {}]} {
# do something
}