小编fo9*_*9z0的帖子

如何在特定字符处拆分字符串并构建不同的字符串组合

我要处理的文本文件中有一些字符串。我尝试了许多正则表达式模式,但没有一个对我有用。

someone can tell/figure
a/the squeaky wheel gets the grease/oil
accounts for (someone or something)
that's/there's (something/someone) for you
Run Code Online (Sandbox Code Playgroud)

我需要以下字符串组合:

someone can tell
someone can figure
a squeaky wheel gets the grease
a squeaky wheel gets the oil
the squeaky wheel gets the grease
the squeaky wheel gets the oil
accounts for someone
accounts for something
that's something for you
that's someone for you
there's something for you
there's someone for you
Run Code Online (Sandbox Code Playgroud)

python regex string combinations list

5
推荐指数
0
解决办法
200
查看次数

标签 统计

combinations ×1

list ×1

python ×1

regex ×1

string ×1