八次出现后,从一行中删除所有标签 [英] Remove all tabs from a line after the eight occurance

查看:158
本文介绍了八次出现后,从一行中删除所有标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在尝试创建一个正则表达式,在八次出现后删除所有标签但我无法弄明白。
示例行:
kdasjla <标签> sadkj ... ksjs< tab nr。 8> ksdjlak djsakd askdj< tab> jsdhskj< tab>

因此,选项卡nr 8之后可能存在的所有选项卡都需要用空格替换。其他字符需要保留。

有没有人有正则表达式模式的建议?
谢谢。

解决方案

我没有在这台计算机上安装Visual Studio,所以正则表达式可能有点不对劲。它将创建一个名为"tabs_to_be_replaced"的命名组。其中包含您要替换的标签。

([^ \\t] * \\t){8}([^ \\t] *(?< tabs_to_be_replaced> \\t))*结果

Hi,


I'm trying to create a regular expression that removes all tabs after the eight occurance but I can't figure it out.
example line:
kdasjla <tab> sadkj...ksjs <tab nr. eight> ksdjlak  djsakd askdj <tab> jsdhskj <tab>

So all tabs that might exist after tab nr eight needs to be replaced by spaces. The other characters needs to be preserved.

Has anyone got a suggestion for the regular expression pattern?
Thanks.

解决方案

I don't have Visual Studio installed on this computer so the regex might be a little bit wrong. It will create a named group called "tabs_to_be_replaced" which contains the tabs you want to replace.

([^\\t]*\\t){8}([^\\t]*(?<tabs_to_be_replaced>\\t))*


这篇关于八次出现后,从一行中删除所有标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆