Joe*_*Joe 5 powershell notepad++ regex batch
我试图找到一个正则表达式来替换这种格式的文本
balle spaziali
bambole e botte
calda emozione
fuori di testa
giovani diavoli
ragazze vincenti
ore contate
Run Code Online (Sandbox Code Playgroud)
通过这种方式
b.... s.......
b...... e b.....
c.... e......
f.... d. t....
g...... d......
r...... v.......
o.. c......
Run Code Online (Sandbox Code Playgroud)
你有想法吗?
我使用 notepad++ 作为文本编辑器,我不知道我是否需要批处理或 powershell 脚本。
谢谢你的任何建议
Tot*_*oto 12
(?<![^a-z])(?<!^)[a-z].解释:
(?<![^a-z]) # negative lookbehind, make sure we haven't a non-letter before
(?<!^) # negative lookbehind, make sure we aren't at the beginning of line
[a-z] # a letter
Run Code Online (Sandbox Code Playgroud)
截图(之前):
截图(后):
您只需要一个正则表达式来标识要转换的字符。这很简单,以下任一方法都可以:\B\S, 或\B\w。
现在您需要一个工具将所有匹配的字符转换为 .
我不使用记事本++,所以我不能说你会怎么做。但这很简单,使用我的JREPL.BAT正则表达式查找/替换命令行实用程序。
假设您要转换为文件“file.txt”:
jrepl "\B\S" "." /f file.txt /o -
Run Code Online (Sandbox Code Playgroud)
或者
jrepl "\B\w" "." /f file.txt /o -
Run Code Online (Sandbox Code Playgroud)
如果将命令放在批处理脚本中,则需要使用,call jrepl因为 JREPL 本身就是批处理脚本。如果没有 CALL,您将不会返回到您的脚本。
您还可以转换管道文本。这是一个简单的例子:
C:\test>echo hello world|jrepl "\B\S" "."
h.... w....
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1060 次 |
| 最近记录: |