小编ngu*_*uvn的帖子

替换文本文件中的标记列表的最佳方法

我有一个文本文件(没有标点符号),文件大小约为 100MB - 1GB,这是一些示例行:

please check in here
i have a full hd movie
see you again bye bye
press ctrl c to copy text to clipboard
i need your help
...
Run Code Online (Sandbox Code Playgroud)

并带有替换令牌列表,如下所示:

check in -> check_in
full hd -> full_hd
bye bye -> bye_bye
ctrl c -> ctrl_c
...
Run Code Online (Sandbox Code Playgroud)

替换文本文件后我想要的输出如下:

please check_in here
i have a full_hd movie
see you again bye_bye
press ctrl_c to copy text to clipboard
i need your help
...
Run Code Online (Sandbox Code Playgroud)

我目前的做法

please check in here …
Run Code Online (Sandbox Code Playgroud)

python token

7
推荐指数
2
解决办法
830
查看次数

在 Java 中删除两个或多个连续数字之间的空格?

如何使用Java中的正则表达式删除句子中两个或多个连续数字之间的空格?

例如,

输入字符串:

Chan dung Mohamed Hilal, ch? 是吗??i?n tho?i 0164 345 6164 có giá 2,2 tri?u 美元。

期望输出:

Chan dung Mohamed Hilal, ch? 是吗??i?n tho?i 01643456164 có giá 2,2 tri?u 美元。

java regex

2
推荐指数
1
解决办法
243
查看次数

标签 统计

java ×1

python ×1

regex ×1

token ×1