Regex 删除-、=或空间注册表项
在tweet开始之前,我必须删除文本文件中Regex 删除-、=或空间注册表项,regex,notepad++,Regex,Notepad++,在tweet开始之前,我必须删除文本文件中-、=或文本:后的空格。到目前为止,我有这个想法文本:,|-|=|这会占用多个空格,但也会删除整个文本文件中的所有空格。这里有几行文字作为示例 发布:Sat 2018年2月3日11:03:09文本:,今天我们可以看到积极的增长趋势,但会有新的下降吗?加密屏幕\u名称:Ksandimo位置:null验证:虚假追随者\u计数:1597好友\u计数:17 lang:ru转发\u计数:0收藏夹\u计数:0 发布时间:2018年2月3日星期六11:03:14文本:
-、=
或文本:
后的空格。到目前为止,我有这个想法<代码>文本:,|-|=|这会占用多个空格,但也会删除整个文本文件中的所有空格。这里有几行文字作为示例
发布:Sat 2018年2月3日11:03:09文本:,今天我们可以看到积极的增长趋势,但会有新的下降吗?加密屏幕\u名称:Ksandimo位置:null验证:虚假追随者\u计数:1597好友\u计数:17 lang:ru转发\u计数:0收藏夹\u计数:0
发布时间:2018年2月3日星期六11:03:14文本:8745.02美元/现在屏幕名称:CoinLibre2009位置:自由世界验证:虚假追随者数量:113朋友数量:110朗:ru转发数量:0喜爱数量:0
发布时间:2018年2月3日星期六11:03:16文本:当前价格为8745.02美元屏幕名称:比特币地址:空验证:虚假追随者数量:44个朋友数量:9个朗:转发数量:0最爱数量:0
发布时间:2018年2月3日星期六11:03:25文本:想想我们现在遇到了比特币的阻力。它会完全恢复吗?我不确定屏幕名称:jasongaved地点:Brighton&Hove/伦敦验证:虚假追随者数量:1996朋友数量:1967 lang:en retweet数量:0收藏数量:0
发布时间:2018年2月3日星期六11:03:28文本:截至2018年2月3日上午11:59,今天的价格为8745.02美元屏幕名称:FR33Q位置:欧洲验证:虚假追随者数量:1164朋友数量:1998朗:转发数量:0喜爱数量:0
发布时间:2018年2月3日星期六11:03:37文本:比特币可能是一个骗局,愤怒发生在这些屏幕上的问题\u name:krrishd\u pzombie位置:你的思想验证:虚假追随者\u计数:28个朋友\u计数:12朗:转发\u计数:0最爱\u计数:0
发布时间:2018年2月3日星期六11:03:50 text:=我认为该图表将采用“区块链技术”,而不是比特币。。。屏幕名称:mt\u加密位置:空验证:假追随者数量:34个朋友数量:90个朗:转发数量:0最爱数量:0
发布时间:2018年2月3日星期六11:04:07文本:比特币当前价格为8745.02美元,通过链屏显示\u名称:kimrin位置:川崎验证:虚假追随者\u计数:690个朋友\u计数:1012郎:ja转发\u计数:0最爱\u计数:0
发布时间:2018年2月3日星期六11:04:14文本:-薪酬?听起来很有趣。比如1比特币?也许是一些以太坊。你在想什么?屏幕名称:rahulsood地点:西雅图华盛顿验证:真正的追随者数量:38820个朋友数量:2224 lang:en retweet数量:0最爱数量:0
样本输出:
发布:Sat 2018年2月3日11:03:09文本:今天我们可以看到积极的增长趋势,但会有新的下降吗?加密屏幕\u名称:Ksandimo位置:null验证:虚假追随者\u计数:1597好友\u计数:17 lang:ru转发\u计数:0收藏夹\u计数:0
发布时间:2018年2月3日星期六11:03:14文本:8745.02美元/现在屏幕名称:CoinLibre2009位置:自由世界验证:虚假追随者数量:113朋友数量:110朗:ru转发数量:0喜爱数量:0
发布时间:2018年2月3日星期六11:03:16文本:当前价格为8745.02美元屏幕名称:比特币地址:空验证:虚假追随者数量:44个朋友数量:9个朗:转发数量:0最爱数量:0
发布时间:2018年2月3日星期六11:03:25文本:想想我们现在遇到了比特币的阻力。它会完全恢复吗?我不确定屏幕名称:jasongaved地点:Brighton&Hove/伦敦验证:虚假追随者数量:1996朋友数量:1967 lang:en retweet数量:0收藏数量:0
发布时间:2018年2月3日星期六11:03:28文本:截至2018年2月3日上午11:59,今天的价格为8745.02美元屏幕名称:FR33Q位置:欧洲验证:虚假追随者数量:1164朋友数量:1998朗:转发数量:0喜爱数量:0
发布时间:2018年2月3日星期六11:03:37文本:比特币可能是一个骗局,愤怒发生在这些屏幕上的问题\u name:krrishd\u pzombie位置:你的思想验证:虚假追随者\u计数:28个朋友\u计数:12朗:转发\u计数:0最爱\u计数:0
发布时间:2018年2月3日星期六11:03:50文本:我相信该图表将采用“区块链技术”,而不是比特币。。。屏幕名称:mt\u加密位置:空验证:假追随者数量:34个朋友数量:90个朗:转发数量:0最爱数量:0
\s{2,}表示多个空间
\s{2,}表示多个空格查找:
文本:\s+[,=\s-]*
替换:文本:
(末尾有一个空格)
改进的解决方案:
^ : beginning of line
.*? : 0 or more any character not greedy
text: : literally "text:"
\h : 1 horizontal space
\K : forget all we have seen until this position
[-=,\h]+ : 1 or more any of these character, dash, equal, comma or horizontal space
posted: Sat Feb 03 2018 11:03:09 text: Today we can see positive trends for growth, but will there be a new fall? crypto screen_name: Ksandimo location: null verified: false followers_count: 1597 friends_count: 17 lang: ru retweet_count: 0 favorite_count: 0
posted: Sat Feb 03 2018 11:03:14 text: 8745.02$ per now screen_name: CoinLibre2009 location: Free World verified: false followers_count: 113 friends_count: 110 lang: ru retweet_count: 0 favorite_count: 0
posted: Sat Feb 03 2018 11:03:16 text: Current price of is $8745.02 screen_name: bitcoinavg location: null verified: false followers_count: 44 friends_count: 9 lang: en retweet_count: 0 favorite_count: 0
posted: Sat Feb 03 2018 11:03:25 text: Think weve hit resistance for Bitcoin now. Will it fully recover? Im not sure screen_name: jasongaved location: Brighton & Hove / London verified: false followers_count: 1996 friends_count: 1967 lang: en retweet_count: 0 favorite_count: 0
posted: Sat Feb 03 2018 11:03:28 text: Today's price is $8745.02 as of February 3, 2018 at 11:59AM screen_name: FR33Q location: Europe verified: false followers_count: 1164 friends_count: 1998 lang: en retweet_count: 0 favorite_count: 0
posted: Sat Feb 03 2018 11:03:37 text: bitcoin might have been a hoax, the issue that the outrage was at these screen_name: krrishd_pzombie location: your mind verified: false followers_count: 28 friends_count: 12 lang: en retweet_count: 0 favorite_count: 0
posted: Sat Feb 03 2018 11:03:50 text: I believe the chart would be adoption of 'blockchain technology' rather than bitcoin individually... screen_name: mt_crypto location: null verified: false followers_count: 34 friends_count: 90 lang: en retweet_count: 0 favorite_count: 0
posted: Sat Feb 03 2018 11:04:07 text: Current price of Bitcoin is $8745.02 via Chain screen_name: kimrin location: Kawasaki verified: false followers_count: 690 friends_count: 1012 lang: ja retweet_count: 0 favorite_count: 0
posted: Sat Feb 03 2018 11:04:14 text: Compensation? Sounds interesting. Like 1 Bitcoin perhaps? Maybe a couple of Ethereum. Whatchu got in mind? screen_name: rahulsood location: seattle washington verified: true followers_count: 38820 friends_count: 2224 lang: en retweet_count: 0 favorite_count: 0
查找:
(?查找:文本:\s+[,=\s-]*
替换:文本:
(末尾有一个空格)
改进的解决方案:
^ : beginning of line
.*? : 0 or more any character not greedy
text: : literally "text:"
\h : 1 horizontal space
\K : forget all we have seen until this position
[-=,\h]+ : 1 or more any of these character, dash, equal, comma or horizontal space
posted: Sat Feb 03 2018 11:03:09 text: Today we can see positive trends for growth, but will there be a new fall? crypto screen_name: Ksandimo location: null verified: false followers_count: 1597 friends_count: 17 lang: ru retweet_count: 0 favorite_count: 0
posted: Sat Feb 03 2018 11:03:14 text: 8745.02$ per now screen_name: CoinLibre2009 location: Free World verified: false followers_count: 113 friends_count: 110 lang: ru retweet_count: 0 favorite_count: 0
posted: Sat Feb 03 2018 11:03:16 text: Current price of is $8745.02 screen_name: bitcoinavg location: null verified: false followers_count: 44 friends_count: 9 lang: en retweet_count: 0 favorite_count: 0
posted: Sat Feb 03 2018 11:03:25 text: Think weve hit resistance for Bitcoin now. Will it fully recover? Im not sure screen_name: jasongaved location: Brighton & Hove / London verified: false followers_count: 1996 friends_count: 1967 lang: en retweet_count: 0 favorite_count: 0
posted: Sat Feb 03 2018 11:03:28 text: Today's price is $8745.02 as of February 3, 2018 at 11:59AM screen_name: FR33Q location: Europe verified: false followers_count: 1164 friends_count: 1998 lang: en retweet_count: 0 favorite_count: 0
posted: Sat Feb 03 2018 11:03:37 text: bitcoin might have been a hoax, the issue that the outrage was at these screen_name: krrishd_pzombie location: your mind verified: false followers_count: 28 friends_count: 12 lang: en retweet_count: 0 favorite_count: 0
posted: Sat Feb 03 2018 11:03:50 text: I believe the chart would be adoption of 'blockchain technology' rather than bitcoin individually... screen_name: mt_crypto location: null verified: false followers_count: 34 friends_count: 90 lang: en retweet_count: 0 favorite_count: 0
posted: Sat Feb 03 2018 11:04:07 text: Current price of Bitcoin is $8745.02 via Chain screen_name: kimrin location: Kawasaki verified: false followers_count: 690 friends_count: 1012 lang: ja retweet_count: 0 favorite_count: 0
posted: Sat Feb 03 2018 11:04:14 text: Compensation? Sounds interesting. Like 1 Bitcoin perhaps? Maybe a couple of Ethereum. Whatchu got in mind? screen_name: rahulsood location: seattle washington verified: true followers_count: 38820 friends_count: 2224 lang: en retweet_count: 0 favorite_count: 0
查找:(?这应该可以满足您的需要
text:[,|\-|=|\s]+
\s将匹配任何空白
+表示匹配前面元素中的一个或多个。在这种情况下,它将匹配任何空格或-=
这应该是你想要的
text:[,|\-|=|\s]+
\s将匹配任何空白
+表示匹配前面元素中的一个或多个。在这种情况下,它将匹配任何空格或-=
尝试替换(/,|-| |=/g',)
。如果要进一步删除空格,请从regx中减少一个空格。尝试替换(/,|-| |=/g',)
。如果要进一步删除空格,请从regx中减少一个空格。
- Ctrl+H
- 查找内容:
^.*?文本:\h\K[-=,\h]+
- 替换为:
留空
- 检查环绕
- 定期快车