【发布时间】:2022-06-13 06:04:37
【问题描述】:
我想把梨橙或牛肉鸭分成第二组
category fruits pear orange
category meat beef duck
我试过了
https://regex101.com/r/bmipyR/1
(category \b(\w+)\b )((\b\w+\b)+)
【问题讨论】:
-
^category [a-z]+ (.+)$and get the first match,然后将它们分组。从您的示例看来,您不想使用single-line,而是使用multi-line。
标签: javascript regex