Guest User

Untitled

a guest
Apr 11th, 2012
125
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $text    = '
  4. first line without links
  5. <a title="bla-bla" href="http://ya.ru/">second string linelink </a>
  6. third line';
  7.  
  8.  
  9. $pattern = '/^(?>(?!(\<a.*href)|\<\/a).)*$/umi';
  10. $result  = preg_match_all($pattern, $text, $matches);
  11. print_r($matches);
RAW Paste Data