[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ossig] gtk applications ?



On 11/02/2005 22:40 Ditesh said the following:
> preg_match() and preg_replace() are much faster than the equivalent ereg 
> calls. I'm not sure performance wise how it compares to perl's regex 

true, but sometimes not as fast as a simple == comparison, or a strcmp. 
perl dudes like to use if($var =~ s/someval/) a lot. this could either be 
translated to PHP as

if(preg_match("/someval/", $var) > 0) OR
if(strstr($var, "someval") != FALSE)

i think the php man pages say that strstr() is a little faster than 
preg_match().

in fact, i've translated all if($var =~ /^abc/) to 
if(strncmp($var,"abc",3)==0). peg that down to my C roots.

> A marvelous way to learn portugese! I remember hacking on java based 

that i'll bear testament to. heck, i'm even beggining to use $contador 
instead of $counter in places where i don't need to. this is one good way 
to translate two languages at the same time, portugese->english and perl->php.

> Ah yes. Will email you later tonight.

got that.

-- 
Regards,                           /\_/\   "All dogs go to heaven."
dinesh@alphaque.com                (0 0)    http://www.alphaque.com/
+==========================----oOO--(_)--OOo----==========================+
| for a in past present future; do                                        |
|   for b in clients employers associates relatives neighbours pets; do   |
|   echo "The opinions here in no way reflect the opinions of my $a $b."  |
| done; done                                                              |
+=========================================================================+


---------------------------------------------------------
To unsubscribe: send mail to ossig-request@mncc.com.my
with "unsubscribe ossig" in the body of the message