Recently I saw a problem in a simple code:
$regexp = "^((http://)|(https://)|(mailto:)|(ftp://))?(([a-zA-Z0-9_.!~*'()-]|(%[0-9a-fA-F]{2})|[;&=+$,])+(:([a-zA-Z0-9_.!~*'()-]|(%[0-9a-fA-F]{2})|[;:&=+$,])+){0}@){0}((((((2(([0-4][0-9])|(5[0-5])))|([01]?[0-9]?[0-9]))\.){3}((2(([0-4][0-9])|(5[0-5])))|([01]?[0-9]?[0-9]))))|(([a-zA-Z0-9](([a-zA-Z0-9-]{0,62})[a-zA-Z0-9])?\.)*([a-zA-Z](([a-zA-Z0-9-]*)[a-zA-Z0-9])?)))?(:(([0-5]?[0-9]{1,4})|(6[0-4][0-9]{3})|(65[0-4][0-9]{2})|(655[0-2][0-9])|(6553[0-5])))?(/((;)?([a-zA-Z0-9_.!~*'()-]|(%[0-9a-fA-F]{2})|[:@&=+$,])+(/)?)*)?(\?([;/?:@&=+$,]|[a-zA-Z0-9_.!~*'()-]|(%[0-9a-fA-F]{2}))*)?(#([;/?:@&=+$,]|[a-zA-Z0-9_.!~*'()-]|(%[0-9a-fA-F]{2}))*)?$";
$urladdr = '89.221.92.122/api/xml';
$result = eregi($regexp, $urladdr);
wamp server returns true, while xampp server returns false! I know that eregi is deprecated, but right know I expect it to work fine in php 5.3.1
My Question
Is there any php or apache config caused this behavior?
A simple test file of the script is uploaded here: eregi on xampp + phpinfo
The above code in my wamp is here: eregi on wamp + phpinfo
I don't want you to solve my problem, I just want to know why this kind of problems happen.