EDIT:
=======================Ok ... jednak już wszystko OK
=======================Postanowiłem się "pobawić" tym co napisałeś.
Chciałem zamienić Twoje wyrażenie regularne na takie, które wyłapuje tylko linki zewnętrzne + nie będące z konkretnych domen np domena.pl, domena1.com
Czyli:
*
http://www.wp.pl - wyczuj
*
http://wp.pl - wyczuj
* www.wp.pl - wyczuj
* /katalog/plik.ext - ignoruj
*
http://domena.pl -ignoruj
*
http://www.domena.pl -ignoruj
*
http://www.domena.pl/kontroler/metoda/ -ignoruj
* www.domena.pl -ignoruj
Wyszedł mi taki potworek:
Kod
<a[^\>]+href="(http://www\.|http://|www\.)(?!((www\.)?(domena\.pl|domena1\.com)))[^"]+"([^\>]+)?>([^\<]+)</a>
Wklepanie tego w preg_match_all działa bez problemu.
$str = <<<TEST
Welcome to RegExr 0.3b, an intuitive tool for learning, writing, and testing Regular Expressions. Key features include:
* real time results: shows results as you type
* code hinting: roll over your expression to see info on specific elements
* detailed results: roll over a match to see details & view group info below
<a href="http://www.wp.pl" title="aa">aaa</a> fdsg </a>
* built in regex guide: double click entries to insert them into your expression
* online & desktop: <a title="ar" href="http://regexr.com" name="saf">bb</a> or download the desktop version for Mac, Windows, or Linux
* save your expressions: My Saved expressions are saved locally
* share and rate expressions: search Community expressions and share your own <a href="http://www.szkolenia24h.pl/aaa/ssss">wew1</a>
Built by gskinner.com with Flex 3 [adobe.com/go/flex] and Spelling Plus <a href="http://szkolenia24h.pl/aaa/ssss">wew2</a> Library for text highlighting [gskinner.com/products/spl].
<a href="/aaa/ssss">wew3</a>
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model<a href="www.wp.pl" title="asd">sentence structures</a>, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need<a href="http://szkolenia24h.pl/aaa/ssss">wew2</a> to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem <a title="ar" href="http://regexr.com" name="saf">bb</a> Ipsum is freepetition, injected humour, or <a href="http://aaa.pl">noncg-haracteristic</a> words etc.
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable.<a href="http://www.kursy24h.pl">aa</a> If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as <a href="http://www.wp.pl" title="asd">noncg-haracteristic</a>necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
TEST;
preg_match_all('/<a[^\>]+href="(http:\/\/www\.|http:\/\/|www\.)(?!((www\.)?(szkolenia24h\.pl|kursy24h\.pl)))[^"]+"([^\>]+)?>([^\<]+)<\/a>/is', $strt, $linki);
jednak użycie tej regułki w Twojej klasie (zamieniając $vars[0]:$vars[1]; na $vars[0]:$vars[6]

nie działa ... zgłupiałem :/
Teoretycznie powinno zachować się tak samo... różnica między wyrażeniami jest taka, że moje zwraca 7 elementów zamiast dwóch ...
(
(
[0] => <a href="http://www.wp.pl" title="aa">aaa</a>
[1] => <a title="ar" href="http://regexr.com" name="saf">bb</a>
[2] => <a href="www.wp.pl" title="asd">sentence structures</a>
[3] => <a title="ar" href="http://regexr.com" name="saf">bb</a>
[4] => <a href="http://aaa.pl">noncg-haracteristic</a>
[5] => <a href="http://www.wp.pl" title="asd">noncg-haracteristic</a>
)
(
[0] => [url="http://www"]http://www[/url].
[1] => http://
[2] => www.
[3] => http://
[4] => http://
[5] => [url="http://www"]http://www[/url].
)
(
[0] =>
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
)
(
[0] =>
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
)
(
[0] =>
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
)
(
[0] => title="aa"
[1] => name="saf"
[2] => title="asd"
[3] => name="saf"
[4] =>
[5] => title="asd"
)
(
[0] => aaa
[1] => bb
[2] => sentence structures
[3] => bb
[4] => noncg-haracteristic
[5] => noncg-haracteristic
)
)
vs
(
(
[0] => <a href="http://www.wp.pl" title="aa">aaa</a>
[1] => <a title="ar" href="http://regexr.com" name="saf">bb</a>
[2] => <a href="http://www.szkolenia24h.pl/aaa/ssss">wew1</a>
[3] => <a href="http://szkolenia24h.pl/aaa/ssss">wew2</a>
[4] => <a href="/aaa/ssss">wew3</a>
[5] => <a href="www.wp.pl" title="asd">sentence structures</a>
[6] => <a href="http://szkolenia24h.pl/aaa/ssss">wew2</a>
[7] => <a title="ar" href="http://regexr.com" name="saf">bb</a>
[8] => <a href="http://aaa.pl">noncg-haracteristic</a>
[9] => <a href="http://www.kursy24h.pl">aa</a>
[10] => <a href="http://www.wp.pl" title="asd">noncg-haracteristic</a>
)
(
[0] => aaa
[1] => bb
[2] => wew1
[3] => wew2
[4] => wew3
[5] => sentence structures
[6] => wew2
[7] => bb
[8] => noncg-haracteristic
[9] => aa
[10] => noncg-haracteristic
)
)