📌  相关文章
📜  带有撇号的单词和单词的正则表达式 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:36.491000             🧑  作者: Mango

代码示例1
/(?:\w|['-]\w)+/
//matches: we, we're, were
//ignores: ' (lone apostrophe),  (whitespace)

OPPOSITE: /\s+|[^'-\w]+|[0-9]+/
//matches: numbers, whitespace, punctuation (except in contractions/hiphenated words)
//ignores: words/contractions/hiphenated words