Jump to content

Archived

This topic is now archived and is closed to further replies.

redarrow

preg_match vs eregi

Recommended Posts

I just was learning preg_match from the manual and i see that theres littile changes to eregi so what can preg_match do what eregi can not.



<?
$match="my little home";

if(preg_match("/little/",$match)) {

echo "matched";

}else{

echo " no match";

}


?>

<?
$match="my little home";

if(eregi("little",$match)) {

echo "matched";

}else{

echo " no match";

}


?>

Share this post


Link to post
Share on other sites
ok i know see the diffrence i used this link to compare the diffrence in exspression code.

http://www.zend.com/manual/reference.pcre.pattern.syntax.php

but i still like eregi theo lol................

Share this post


Link to post
Share on other sites
PCRE:
[list]
[*]are (typically) faster;
[*]are binary safe;
[*]allow greediness modifications;
[*]have better shortcuts (in my opinion);
[*]are more advanced (lookarounds, recursion, subpatterns);
[*]are decimal, octal, hex, UTF-8, and Unicode friendly;
[*]have more switches, especially a documentation-friendly one (x).
[/list]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.