I am new to php regex. 我是php正则表达式的新手。 I am trying to match any number of words. 我正在尝试匹配任意数量的单词。 For eg: A 'person name' can have any number of words, how can I do this? 例如:“人名”可以有任意数量的单词,我该怎么做?
I tried using \\w+\\
, but its matching only 1 word. 我尝试使用\\w+\\
,但仅匹配1个单词。
DEMO 演示