Advertisement
Guest User

Untitled

a guest
Apr 11th, 2012
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.25 KB | None | 0 0
  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);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement