我尝试解析内容并找到Soundcloud网址。我的正则表达式可以工作,但不会在空间后停止捕捉。url:停止空间捕获
$re = '/((http:\/\/(soundcloud\.com\/.*|soundcloud\.com\/.*\/.*|soundcloud\.com\/.*\/sets\/.*|soundcloud\.com\/groups\/.*|snd\.sc\/.*))|(https:\/\/(soundcloud\.com\/.*|soundcloud\.com\/.*\/.*|soundcloud\.com\/.*\/sets\/.*|soundcloud\.com\/groups\/.*)))/i';
正如你可以在这里看到https://regex101.com/r/4BZhlu/1当URL是直列它不会停止。
在此先感谢。
替换所有'*'和'\ S *'。 –