Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨,我正在尝试从 NAND[0] 之类的单词中删除括号,我希望结果为 NAND0。如何在 Tcl 中使用正则表达式进行编码。
假设要从中去除括号的val数据位于变量中,并将转换后的数据存储在变量中result
val
result
set result [regsub -all {\[|\]} $val ""]
你也可以做
regsub -all {\[|\]} $val "" result