需要正则表达式来匹配-string中www.example.com
的链接,但是:html/text
- 不匹配
"www. some text after"
- 不匹配
"www" only such as "some text before www some text after"
- 与链接不匹配
http
- 必须以空格 (
\s
) 或非字符开头,例如:" www.example.com"
或"www.example.com"
我试过:
'/(^|\s)(www[^\s].[^<> \n\r \s]+)/iex'
但也匹配"www. some text after"