模式在给定文本中查找PHP中的特定对象

模式在给定文本中查找PHP中的特定对象,php,regex,preg-match-all,Php,Regex,Preg Match All,我很难找到具有preg_match_all模式的特定对象。我有一条短信。但我只想找到一个具体的 $pattern = '#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#'; preg_match_all($pattern, $parsePage, $matches); print_r($matches[0]); 就像我有一串文字一样 sadasdasd:{"website":["https://bitcoin.o

我很难找到具有preg_match_all模式的特定对象。我有一条短信。但我只想找到一个具体的

$pattern = '#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#';
preg_match_all($pattern, $parsePage, $matches);
print_r($matches[0]);
就像我有一串文字一样

sadasdasd:{"website":["https://bitcoin.org/"]tatic/cloud/img/coinmarketcap_grey_1.svg?_=60ffd80');display:inline-block;background-position:center;background-repeat:no-repeat;background-size:contain;width:239px;height:41px;} .cqVqre.cmc-logo--size-large{width:263px;height:45px;}
/* sc-component-id: sc-2wt0ni-0 */
但是,我只需要找到以下网站:[https://bitcoin.org/]. 其中网站是动态数据。例如,网站可以是谷歌网站:[https://google.com/]

现在我有这样的东西。这只是返回大量URL。我需要的只是具体的

$pattern = '#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#';
preg_match_all($pattern, $parsePage, $matches);
print_r($matches[0]);

我在模式方面非常糟糕,并且一直坚持着这一点

在下一次出现之前,您可以获得网站前缀后面的所有数据[^]+:


正如您可以检查的那样

但是,可能存在大量URL。我只需要网站的url:[]好的,检查更新的代码,然后谢谢。爱你
https://bitcoin.org/