Skip to content

Instantly share code, notes, and snippets.

@paulchubatyy
Created March 3, 2011 09:19
Show Gist options
  • Save paulchubatyy/852548 to your computer and use it in GitHub Desktop.
Save paulchubatyy/852548 to your computer and use it in GitHub Desktop.
<?php
$reg_exp = '#<a [^>]*href=\\?[\'"](?P<url>http:\/\/[0-9a-z]+\.[0-9a-z]{5,10}\.(pay|hop)\.clickbank\.net)\\?[\'"][^>]*>#is';
$text = '
ololololol trolololololol
<a href=\"http://123.ololo.pay.clickbank.net\">ololol trololo</a>
<a href=\"http://affiliate.ol00lo.hop.clickbank.net\">ololo trololo</a>
';
$matches = array();
echo 'Matches: ', preg_match_all($reg_exp, $text, $matches) , PHP_EOL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment