【发布时间】:2021-05-07 09:36:28
【问题描述】:
是否有正则表达式、python 或 javascript 方法来搜索句点、单词和定义,然后将其附加到字典或其他对象?
例如:
。回归:回归是再次回到以前的状态或条件。修辞:修辞是使用语言说服或影响人们的技能或艺术,尤其是听起来令人印象深刻但可能不真诚或不诚实的语言。
这将变成{"Reversion" : "A reversion is turning back again to a previous state or condition", "Rhetoric" : "Rhetoric is the skill or art of using language to persuade or influence people, especially language that sounds impressive but may not be sincere or honest" }
【问题讨论】:
-
/\. (.*): (.*)\./这应该可以工作 -
我不会为此使用正则表达式,这是一个相当复杂的表达式。请记住:“有些人在遇到问题时会想“我知道,我会使用正则表达式。”现在他们有两个问题。”
标签: javascript python regex