Re: [PHP] fail on preg_match_all

2008-02-21 Thread Richard Lynch
On Wed, February 20, 2008 11:34 pm, Hamilton Turner wrote: > Does anyone know why a server would simply fail on this line? > > $num = preg_match_all($regex, $theData, $match, PREG_SET_ORDER); > > if i know the file handle is valid (i grabbed it using 'or die'), and > the regex is valid Define "fai

Re: [PHP] fail on preg_match_all

2008-02-21 Thread Robin Vickery
On 21/02/2008, Nathan Rixham <[EMAIL PROTECTED]> wrote: > The regex looks incorrect to me in a few places: > -\d+] {1,4} > for example. That's ok, albeit confusing: * The ']' is a literal ']' not the closing bracket of a character class. * The {1,4} applies to the space character. -robin --

Re: [PHP] fail on preg_match_all

2008-02-21 Thread Nathan Rixham
Hamilton Turner wrote: Just a follow-up on this, the problem was 'Fatal error: Allowed memory size of 8388608 bytes exhausted' After some nice help, I found that this is actually a common problem with intense regexes in php. Quick fix is using ini_set() to increase your memory_limit to someth

Re: [PHP] fail on preg_match_all

2008-02-21 Thread Stut
Hamilton Turner wrote: Just a follow-up on this, the problem was 'Fatal error: Allowed memory size of 8388608 bytes exhausted' After some nice help, I found that this is actually a common problem with intense regexes in php. Quick fix is using ini_set() to increase your memory_limit to someth

Re: [PHP] fail on preg_match_all

2008-02-20 Thread Hamilton Turner
Just a follow-up on this, the problem was 'Fatal error: Allowed memory size of 8388608 bytes exhausted' After some nice help, I found that this is actually a common problem with intense regexes in php. Quick fix is using ini_set() to increase your memory_limit to something massive, like '400M'

Re: [PHP] fail on preg_match_all

2008-02-20 Thread Paul Scott
On Wed, 2008-02-20 at 23:34 -0600, Hamilton Turner wrote: > if i know the file handle is valid (i grabbed it using 'or die'), and ^ This is probably your problem, you are trying to match on a resource handle, not a string or something. Check out http://www.php.net/pre

Re: [PHP] fail on preg_match_all

2008-02-20 Thread Jim Lucas
Hamilton Turner wrote: Does anyone know why a server would simply fail on this line? $num = preg_match_all($regex, $theData, $match, PREG_SET_ORDER); if i know the file handle is valid (i grabbed it using 'or die'), and the regex is valid hamy Wow, what a lack of information! If I was ho

Re: [PHP] fail on preg_match_all

2008-02-20 Thread Chris
Hamilton Turner wrote: Does anyone know why a server would simply fail on this line? $num = preg_match_all($regex, $theData, $match, PREG_SET_ORDER); if i know the file handle is valid (i grabbed it using 'or die'), and the regex is valid What file handle? preg_match doesn't work on resource

[PHP] fail on preg_match_all

2008-02-20 Thread Hamilton Turner
Does anyone know why a server would simply fail on this line? $num = preg_match_all($regex, $theData, $match, PREG_SET_ORDER); if i know the file handle is valid (i grabbed it using 'or die'), and the regex is valid hamy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit