Re: Frontbase CLOB newline problem
Re: Frontbase CLOB newline problem
- Subject: Re: Frontbase CLOB newline problem
- From: Q <email@hidden>
- Date: Thu, 13 Nov 2008 01:34:50 +1000
On 13/11/2008, at 1:16 AM, Mike Schrag wrote:
String comments = aListing.additionalComments().replaceAll("(\r?\n|
\r)", "\\\\n");
Just to continue this discussion unnecessarily, but you might as
well drop the ? from this, right? You really only care about \r\n,
not bare \n's, so you could make it a little easier and just have:
String comments = aListing.additionalComments().replaceAll("(\r\n|
\r)", "\\\\n");
To achieve what lachlan was aiming for, ie. replace \r, \r\n or \n
with the string '\' + 'n', you would still need to match the \n case.
As an aside, I love the escaping that is required in the Java
regex. It's mostly ridiculous.
Yes, it's mind numbing.
--
Seeya...Q
Quinton Dolan - email@hidden
Gold Coast, QLD, Australia (GMT+10)
Ph: +61 419 729 806
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden