Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- php won't recognize a carriage return
March 30, 2005, 2:18 am
rate this thread
i need to read a file and match a regular expressions with this
preg_match($title_reg, $line, $resB);
if (ereg($find_reg, $line2))
now if i put this pattern in powergrep 2.3.2 it recognizes it. however
if i try to use this pattern in my php script i get bupkis nada nothing
zero. i've tried putting the carriage return in () and in  but i get
nothing still. when i print the pattern to my browser i see a space in
front of my title showing me that php is recognizing something but it
does not print the \r\n so i'm pretty sure that is why i'm not getting
a match.now i know these are not printable characters but they are in a
string so they should print to the screen.
So my assumption is that php is erasing or translating /r/n into
something so that it does not match my pattern.