Hi, I have seen a bug in regexp matching. I verified VS external regexp engines that indeed im not mistaken.

Recreation:

set data {0000}
regexp {\n?(0+?)} $data a b

This will place '0000' in b variable
The correct result is to place '0' in b variable

So in this case the '+?' is treated as '+"

BTW when omitting the '\n?' from the beginning of the regexp the problem is gone and the correct assignment is made to b - '0'