Helloo.. i need help with a reg expression
project.

What I am trying to do is to get only the text strings that have
a ".mov" name, meaning *****.mov
is a match, and not "move" or "movie" or "mover".

When i use these few lines of code, i get the proper results in PHP 4.11
(its on my webhost, installed as a CGI with NO gd support)

$chars = preg_split('[([a-z]*.mov)]', $oldstring, -1, PREG_SPLIT_DELIM_CAPTURE);
$output = array_slice ($chars, 1);

// bumps up all keys to remove the null value of key 0 in chars

while (list($key, $val) = each($output)) {
next($output);
echo "$val<br>";
}

results

anamorphic.mov
anabolic.mov
polymorph.mov
seismograph.mov

and on my PWS (v 4.04) i get the opposite results
when using the same code, it strips out these:

anamorphic.mov
anabolic.mov
polymorph.mov
seismograph.mov


// i used the "next(); to advance the pointer, since other keys
//in the array were not what i wanted to display.

// Code worked fine on the internet, (v4.11 CGI module)
// My PWS at home, is running php 4.04 with GD support
// I read in the PHP manual, that the clause PREG_SPLIT_DELIM_CAPTURE
// flag was added for PHP 4.05

// as i mentioned earlier, my webhost is running 4.11

// i tried like a maniac to upgrade to a higher version
of PHP, but it was a NIGHTMARE, so i rolled back to 4.04

Does anyone know how I can generate the desired results
with PHP 4.04 (changing versions has proven too difficult)

Thanks

    Write a Reply...