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 #172327 is a reply to message #172325] Sun, 13 February 2011 04:16 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On 13/02/11 02:49, Evan Platt wrote:
> On Sat, 12 Feb 2011 21:44:27 -0500, Jerry Stuckle
> <jstucklex(at)attglobal(dot)net> wrote:

>>> If you really were the computer expert, it would take you all of 10
>>> minutes to find out it's my real name. I've got nothing to hide.

>> You don't get it, stoopid. You aren't even worth the 10 minutes you
>> claim it would take for me to find out.

> And how much time have you spent claiming it's not my real name vs how
> much time would you have spent to find out it is my real name?

>> You're the only one here less respected than Richard, troll. Everyone
>> else here sees you for exactly what you are.

> I must have missed the vote you took.

Richard's basic approach is fundamentally correct. It doesn't take all
possibilities into account, for example if the input data may have \r\n
or \n, it might also have \r without \n, and the OP needs to consider
how to handle those cases, and also whether he wants to trim multiple
\r\n combinations to a single \r\n.

eg replace any sequence of one or more of either \r or \n or a mix of
the two with a single \r\n

$contents = preg_replace("/[\r\n]+/","\r\n",$contents);

How the OP adopts it to match his requirement is up to the OP, there's
other solutions that have been posted (and yes I know I missed regex
delims off of mine), but basically, this time, richard was right, you
were wrong to dismiss his solution without even considering it, and
you're making yourself look more of a dickhead than richard usually
appears to be.

That's actually a pretty impressive feat.

Rgds

Denis McMahon
[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 04:35:01 GMT 2024

Total time taken to generate the page: 0.04574 seconds