小编Mik*_*elo的帖子

如何从保留转义哈希字符的文件中删除所有评论

我知道以前有人问过这个问题,但这只是有点不同:我需要删除所有评论,不包括转义#或其他不意味着开始评论(在单顶点或双顶点之间)

从以下文本开始:

test
# comment
comment on midline # comment
escaped hash "\# this is an escaped hash"
escaped hash "\\# this is not a comment"
not a comment "# this is not a comment - double apices"
not a comment '# this is not a comment - single apices'
this is a comment \\# this is a comment
this is not a comment \# this is not a comment
Run Code Online (Sandbox Code Playgroud)

我想获得

test
comment on midline
escaped hash "\# …
Run Code Online (Sandbox Code Playgroud)

text-processing

6
推荐指数
1
解决办法
1471
查看次数

标签 统计

text-processing ×1