"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Excellent point! I find my self using regex's a bit to often when there > are other solutions available. > > btw, have you ever tested the difference between > > if(ereg('^[0-9]{6}$',$str)) > if(preg_grep('^[0-9]{6}$',$str)) > > I've been meaning to find out advantages/disadvantages with PERL vs. > POSIX compatible. Without getting too far astray from the real subject, I was once writing a script opening a textfile and modifying the whole contents to create a new file, using POSIX compatible expressions. My script timed out (30sec+) at some 400kb. I read Perl compatible was faster, and so I modified my script to use those. Result : done in a couple of secs.
I bet it depends on the type of expression (these were a bunch of replaces) but for larger input or many iterations I'd rather use Perl compatible... -- [Win2000 | Apache/1.3.23] [PHP/4.2.3 | MySQL/3.23.53] Ivo Fokkema PHP & MySQL programmer Leiden University Medical Centre Netherlands -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php