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.
我有这个正则表达式:
diff.\*\n.\*\n.\*\n.\*\n.\*\n
我想匹配从单词“diff”到第五个新行的所有内容。有人可以为我简化吗?
您需要分组:
diff(?:.*\n){5}
我想你在问这个:
/diff(.*\n){5}/