最長の繰り返しパターンから文字列を削除する方法を探しています。
私は約1000のWebページのタイトルのリストを持っていますが、それらはすべて、Webサイトの名前である共通のサフィックスを共有しています。
彼らはこのパターンに従います:
['art gallery - museum and visits | expand knowledge',
'lasergame - entertainment | expand knowledge',
'coffee shop - confort and food | expand knowledge',
...
]
共通のサフィックスからすべての文字列を自動的に削除するにはどうすればよい" | expand knowledge"
ですか?
ありがとう!
編集:申し訳ありませんが、私は自分自身を十分に明確にしませんでした。接尾辞についての情報" | expand knowledge"
は事前にありません。共通のサフィックスの可能性がある文字列のリストを、それが何であるかわからなくてもクリアできるようにしたい。