0

我的工作涉及处理大量数据。我使用 textwrangler 作为文本编辑器,但我想所有文本编辑器上的东西都会保持不变。

所以我有一个网址

 http://example.com/swatches/frisk-watches/pr?p[]=sort%3Dpopularity&sid=812%2Cf13&offer=GsdOfferOnWatches07.&ref=4c83d65f-bfaf-4db6-b5f5-d733d7b1d2af

以上是一个示例网址

我想捕获文本 GsdOfferOnWatches07。即来自 offer= 和 until &ref 的文本在 textwragler Ctrl+F 功能上使用正则表达式。

我怎样才能做到这一点?

4

1 回答 1

2
$link = 'http://example.com/swatches/frisk-watches/pr?p[]=sort%3Dpopularity&sid=812%2Cf13&offer=GsdOfferOnWatches07.&ref=4c83d65f-bfaf-4db6-b5f5-d733d7b1d2af';

preg_match('/offer=(.*?)&ref/', $link, $match);      
echo $match[1];'
于 2014-02-18T09:39:04.127 回答