FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » How do I do this search and replace?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: How do I do this search and replace? [message #172306 is a reply to message #172305] Sun, 13 February 2011 00:08 Go to previous messageGo to previous message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma:
Senior Member
In article <ij76st$b68$1(at)news(dot)eternal-september(dot)org>,
sheldonlg <sheldonlg(at)thevillages(dot)net> wrote:

> On 2/12/2011 5:09 PM, Evan Platt wrote:
>> On Sat, 12 Feb 2011 14:20:16 -0700, richard<member(at)newsguy(dot)com>
>> wrote:
>>
>>> 1) replace all "\r\n" with "\n"
>>> 2) replace all "\n" wtih "\r\n"
>>
>> Just when I think you can't say anything dumber, you open your mouth
>> and prove me wrong.
>
> Huh? Why did you say that? It seemed perfectly reasonable to me! You
> don't have any "\r" all by itself in the string, so replacing all "\r\n"
> gets rid of all "\r". Then converting all the "\n" to "\r\n" results in
> what the OP was asking for. Of course, it is just as easy to first
> convert all the "\r" to "", but what he presented made sense.
>
> Why do you think this is "dumb" -- or is it just more of your "thing"
> against Richard?

I must say I agree and it's what I've done in the exact same situation.

Personally I hate regexps as being essentially write-only programming.
I'm not interested in wracking my brains to create something "cooler"
than the solution offered above, merely so that 5 minutes later I can't
understand it any longer.

Someone had a .sig about Dijkstra (sp?) saying KISS and IMO this is an
example of where it applies.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Curious problem
Next Topic: Hot Sameera Hot Cleavage show - Download
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 07:30:08 GMT 2024

Total time taken to generate the page: 0.04109 seconds