首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >TCL删除匹配regexp范围内的内容

TCL删除匹配regexp范围内的内容
EN

Stack Overflow用户
提问于 2019-11-11 15:49:48
回答 1查看 54关注 0票数 0

我有一个输入文件,如下所述

代码语言:javascript
复制
module bist_logic_inst(a, ab , dhd, dhdh , djdj, hdh, djjd, jdj, dhd, dhp, dk
);
input a;
input ab;
input dhd;
input djdj;
input dhd;
output hdh;
output djjd;
output jdj;
output dk;
// MBIST Structures 
mvusr1 ssbs1:dhdhd ala;
hheh ls djd : kdkd akk;

);


bist_reverse_mapper Umbist_reverse_inst(  .BIST_SO(), .BIST_SO_ts1(), .BIST_SO_ts2(), .BIST_SO_ts3(), .BIST_GO(), .BIST_GO_ts1(), 
      .BIST_GO_ts2(), .BIST_GO_ts3(), .clk_mbist(), .BIST_SETUP(), .ltest_to_mcp_bounding_en(), 
      .MEM0_BIST_COLLAR_SI(), .MEM1_BIST_COLLAR_SI(), .MEM2_BIST_COLLAR_SI(), .MEM3_BIST_COLLAR_SI(), 
      .bistEn(), .BIST_COLLAR_DIAG_EN(), .ltest_to_en(), .BIST_EVEN_GROUPWRITEENABLE(), 
      .BIST_ODD_GROUPWRITEENABLE(), .BIST_SELECT(), .BIST_WRITEENABLE()
  );

endmodule 

我需要删除//MBIST结构和)之间的内容;

我的输出文件应该是

代码语言:javascript
复制
module bist_logic_inst(a, ab , dhd, dhdh , djdj, hdh, djjd, jdj, dhd, dhp, dk
);
input a;
input ab;
input dhd;
input djdj;
input dhd;
output hdh;
output djjd;
output jdj;
output dk;



bist_reverse_mapper Umbist_reverse_inst(  .BIST_SO(), .BIST_SO_ts1(), .BIST_SO_ts2(), .BIST_SO_ts3(), .BIST_GO(), .BIST_GO_ts1(), 
      .BIST_GO_ts2(), .BIST_GO_ts3(), .clk_mbist(), .BIST_SETUP(), .ltest_to_mcp_bounding_en(), 
      .MEM0_BIST_COLLAR_SI(), .MEM1_BIST_COLLAR_SI(), .MEM2_BIST_COLLAR_SI(), .MEM3_BIST_COLLAR_SI(), 
      .bistEn(), .BIST_COLLAR_DIAG_EN(), .ltest_to_en(), .BIST_EVEN_GROUPWRITEENABLE(), 
      .BIST_ODD_GROUPWRITEENABLE(), .BIST_SELECT(), .BIST_WRITEENABLE()
  );

endmodule 

我知道如何提取范围,但这对删除regexp之间的内容没有帮助。

EN

回答 1

Stack Overflow用户

发布于 2019-11-11 23:00:07

您可以将文件作为单个字符串读取(使用read命令),然后可以对该字符串使用regsub。使用模式// MBIST Structures.*?\);并将其替换为空字符串(请注意非贪婪量词*?)。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58797391

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档