tcl regexp regsub

regsub:替換字符串

regexp:匹配

set cellName INV1_90S9T16L
if {[regexp {16UL$} $cellName match]==0} {
puts "1111111111111111111111"
                if {[regsub {16.*$} $cellName "16UL" newCell]} {
                 puts "222222222222222222"
puts "$newCell"
                    }

                    }
 

打印結果:

1111111111111111111111
222222222222222222
INV1_90S9T16UL
 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章