I'm obviously missing something very important about how regular expressions are supposed to work. I still haven't found answers for my previous questions, BTW. Here is the new problem:
This time I don't want to print anything in a Web page. I just want to pre-process a text file. I have:
bababa
cacaca
dadada
fafafa
I want to remove all line breaks and separate all elements with a '#' symbol, like this:
bababa#cacaca#dadada#fafafa#...
so I apply:
$result1 = preg_replace ("/\r/", "#", $line);
The result, however, is:
bababa#
cacaca#
dadada#
fafafa#
That is \r PLUS a '#' symbol. I want to <u>remove</u> line breaks. What am I doing wrong???
Thanks,
Luciano ES
Santos, SP - Brasil