Re: Going nuts with this, cant figure out whats the prob
| From: | Ryan A | Date: | Mon, 15 May 2006 12:30:37 +0000 |
| Subject: | Re: Going nuts with this, cant figure out whats the prob | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-236188@lists.php.net to get a copy of this message | ||
Hey Chris / Richard,
> I was wondering if the different line endings
> (dos/unix) might play a
> factor but I doubt it.
Chris:
Ok, that really helped, I was testing the test.txt
file on my Win2k machine and was testing the whole
script on a FreeBSD machine... so I took the small
test and upped it on the FreeBSD machine, ran it and
this is what I got:
----------- output ----------
In
while(),Start..193.150.249.47|-|200|18897|/usr/local/www/nocme.com/www/coinpass/coinpass|----End
of stdin
Fatal error: Call to undefined function:
preg_match() in
/usr/local/www/nocme.com/www/coinpass/test/test_regex.php
on line 12
----------- output ----------
As you can see it is reading the first line without a
problem, as it touches preg_match it screws up,
searching google I see that the problem might be that
PCRE has not been installed on this machine
(http://wordpress.org/support/topic/67726) , will
contact the host.
Thanks for your help again, I hope this helps someone
else later on.
Richard:
<clip>
You *DO* see this bit in the log right?...
And is $line what you expect it to be, newlines and
all?...
</clip>
Its exactly as it should be...
<clip>
$pattern="/^(\d+\.\d+\.\d+\.\d+)\|(.+)\|(\d+)\|([\d-]+)\|(.+)\|(.+)$/";
It's NOT your problem, but...
\ has an awful lot of different meanings inside of "
marks in PHP.
I'd recommend using \\ to get a single \ embedded in a
string.
</clip>
I didnt write that, am still learning the basics of
REGEX and fooling around with the "regex coach",
according to that it does match the pattern I am
looking for, want to tune it a bit but for now will
let it be till I can understand regex better.
Thanks for the advise on future regex writing though,
I am sure it will come in handy when I understand
regexs a bit better.
The thing is, I thought this was bundled with the
standard package of PHP, if yes, why would anybody
want to turn this off?
Thanks!
Ryan
------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
-----
Fight back spam! Download the Blue Frog.
http://www.bluesecurity.com/register/s?user=bXVzaWNndTc%3D
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com