PCRE regex result is different between Linux & Windows.

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

 



Hi,

[I precede you, sorry for language mistakes...]

I have done a pretty regex which can normally strip all the empties HTML tags. With PHP v5.2.4, under Windows XP, preg_replace() gives me 90 matches (which is correct) while under linux it stagnate to 54.

Let me introduce this regex :
$pattern = '
@
<([a-z0-9]+)[^>]*>     # open tag
  (?:[\s|(?:&nbsp;)]*| # white characters (ugly ?)
    (?R))*             # recursion (parent tag is empty to ?)
</\s*\1\s*>            # close tag
@Sux'; // I love those pattern's options !! :-D)

So, is it normal that I have this big difference for matches (Windows vs Linux) ?

I thought it was a recursion trouble so I include the preg_replace() in a do/while structure. It did not change anything...

If anyone can tell me about it, it will be a pleasure !


--
Julien


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux