RE: [PHP] preg_match fails to fill $matches

2003-03-05 Thread John W. Holmes
> >> The full code in the loop is. > >> Later on in the code after the loop I do > >> > >> echo "printing array matches "; > >> print_r ($matches);echo ""; > > > >$matches is going to be over-written after every time through the loop! > It > >doesn't add it all up. > > > >Add in a > > > >$var[] = $

Re: [PHP] preg_match fails to fill $matches

2003-03-05 Thread {R}ichard Ashton
On Wed, 5 Mar 2003 12:06:41 -0500, 1LT John W. Holmes wrote: >> The full code in the loop is. >> Later on in the code after the loop I do >> >> echo "printing array matches "; >> print_r ($matches);echo ""; > >$matches is going to be over-written after every time through the loop! It >doesn't add

RE: [PHP] preg_match fails to fill $matches

2003-03-05 Thread John W. Holmes
> Also, try removing the 's' from outside the pattern matching in $ts. > You might get back some useful information. > > usage: pmatch [ -cfghilnv ] '/pattern/' [ file ] ... > -s: supress error messages about missing or unreadable files The 's' in preg_* means something different: "If this

Re: [PHP] preg_match fails to fill $matches

2003-03-05 Thread Jason k Larson
What is the value of $trigger_string in your $ts variable? Also, try removing the 's' from outside the pattern matching in $ts. You might get back some useful information. usage: pmatch [ -cfghilnv ] '/pattern/' [ file ] ... -c : show only line count for each file -f : show only filen

Re: [PHP] preg_match fails to fill $matches

2003-03-05 Thread 1LT John W. Holmes
> >What's your actual code? How are you looking for the match in $matches? > >If something was matched, then it'll be there. > > The full cod in the loop is. > > $cnt = 0; > while(!feof($fp)) > { > // Get body > $line_in = fgets($fp,4096); > $cnt++; > // looking for the other

Re: [PHP] preg_match fails to fill $matches

2003-03-05 Thread {R}ichard Ashton
On Wed, 5 Mar 2003 10:21:30 -0500, 1LT John W. Holmes wrote: >> $ts = '/(' . $trigger_string .')/is'; >> echo "trigger_string is $ts "; >> $matches = array(); >> $hit = array(); >> >> In the loop >> >> $hit[] = preg_match ($ts, $line_in,$matches); >> >> Now the $hit array fills up correctly, i

Re: [PHP] preg_match fails to fill $matches

2003-03-05 Thread 1LT John W. Holmes
> $ts = '/(' . $trigger_string .')/is'; > echo "trigger_string is $ts "; > $matches = array(); > $hit = array(); > > In the loop > > $hit[] = preg_match ($ts, $line_in,$matches); > > Now the $hit array fills up correctly, if the trigger string is on the > line just read in, putting 1 or 0 in $h

[PHP] preg_match fails to fill $matches

2003-03-05 Thread {R}ichard Ashton
I have At the top of a loop $ts = '/(' . $trigger_string .')/is'; echo "trigger_string is $ts "; $matches = array(); $hit = array(); In the loop $hit[] = preg_match ($ts, $line_in,$matches); Now the $hit array fills up correctly, if the trigger string is on the line just read in, putting