Originally posted by John Boyles
Ok - this one is starting to drive me nuts!
I can not get certain regular expressions to evaluate properly in my TCL script. I am trying to ensure that a variable starts with 12 numbers.
echo [regexp {[^d{12}]} $obx14] <-- should eval to "true" if $obx14 starts wtih 12 numbers
Have also tried these equivalent statements...
^dddddddddddd
^[0-9]{12}
All should return true only if the string begins with 12 numbers. I've tested all of these in other environments and they work properly. However, all will incorrectly evaluate to "true" for empty strings or for strings of numbers < 12 in TCL. See below:
<blank> = true
1 = true
1a = false
1111 = true
a = false
Any ideas?