Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要一个正则表达式来选择字符串中除前 3 个单词之外的所有单词。例如一个字符串:“Have a very nice day”应该返回“nice day”
假设“单词”是字母和撇号(例如“can't”):
^([a-zA-Z']+\s+){3}(.*)
(\w+ ){3}(.*)
第二个捕获括号, $2, 是你想要的
$2