Mailinglisten-Archive |
> So sprach Jochen Kaechelin am Sun, May 06, 2001 at 11:26:55AM +0200:
> > if(preg_match("/www.xyz.de/",$eingabe)) {
> > echo "match enthalten!";
>
> Besser stristr nehmen - ist schneller!
>
> Alexander Skwar
preg_match("/name=[ ]?(['\"])?((?(1)[^\\1]|[^\s\>])+?)(?(1)\\1|[\s>])/
i", $string,$arr );
eregi( "name=[\"']{0,1}([_0-9a-zA-Z]+)[\"']{0,1}", $string, $arr );
Note: The preg_match expression is actually far more accurate that the
eregi
as well as complex. It handles the case of "name=34 multiple>" as
well as
"name='my select'". Both expressions were also case insensitive.
The results:
preg_match
Timer: This page was generated in 0.26572799682617 seconds.
eregi
Timer: This page was generated in 1.2171900272369 seconds.
--
phpArbeitsgruppe in Gruendung - Jochen Kaechelin
Stuttgarter Str.3, D-73033 Goeppingen
Tel. 07161-92 95 94, Fax 07161-92 95 98
http://www.php-arbeitsgruppe.de, mailto:info_(at)_php-arbeitsgruppe.de
php::bar PHP Wiki - Listenarchive