TA的每日心情 | 无聊 2022-7-21 15:56 |
---|
签到天数: 216 天 [LV.7]常住居民III
状元
- 积分
- 16738
|
本帖最后由 wjl 于 2020-8-2 12:58 编辑
如何用EmEditor正则表达式进行词组拆分?
Al/A-one ; P0001
更改为
Al/A-one ; P0001
Al; P0001
A-one ; P0001
___________________________________________________
quarrel (with sb) about/for/over ; 2313
更改为
quarrel (with sb) about/for/over ; 2313
quarrel with sb about ; 2313
quarrel with sb for ; 2313
quarrel with sb over ; 2313
quarrel about ; 2313
quarrel for ; 2313
quarrel over ; 2313
___________________________________________________
dabble at/in/with
更改为
dabble at/in/with
dabble at
dabble in
dabble with
___________________________________________________
damn and blast (sb/sth)
更改为
damn and blast (sb/sth)
damn and blast sb
damn and blast sth
damn and blast
___________________________________________________
dance on/upon a rope/nothing
更改为
dance on/upon a rope/nothing
dance on a rope
dance upon a rope
dance on a nothing
dance upon a nothing
___________________________________________________
dance on (the) air
更改为
dance on (the) air
dance on the air
dance on air
___________________________________________________
dead/flat/stark calm
更改为
dead/flat/stark calm
dead calm
flat calm
stark calm
___________________________________________________
do/go/make the/one's round
更改为
do/go/make the/one's round
do the round
go the round
make the round
do one's round
go one's round
make one's round
___________________________________________________
do (sb/sth) grace
更改为
do (sb/sth) grace
do sb grace
do sth grace
do grace
___________________________________________________
固定一种模式的话比较好处理,难度在于/和()的出现次数和位置不固定,可能连续出现,也可能分散出现,两者也可能混合在一起出现。示例文件链接: https://pan.baidu.com/s/18rt8d7KxYOsioihLEXxzfQ 提取码: qn3k。如果EmEditor正则表达式不可行的话,用python代码也行
Al/A-one ; P0001这种简单的可以用
\b(\w+)\b/\b([\w-]+)\b(\s{1,});\tP(\d{4})
替换为:
\1/\2\3;\tP\4\n\1\3;\tP\4\n\2\3;\tP\4
|
|