Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #4206

Re: Regx problem

Path csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.help
Subject Re: Regx problem
Date Sun, 27 Aug 2017 16:53:32 -0400
Organization A noiseless patient Spider
Lines 32
Message-ID <onvb89$3nv$1@dont-email.me> (permalink)
References <hhr5qcpbuc0fcajj5hnvuegtgv50ou5vpq@4ax.com> <asa6qc100b4rr1jufdbllg4etgedc4rpr1@4ax.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Sun, 27 Aug 2017 20:49:13 -0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="63738243d773c9163389b15618e2cef0"; logging-data="3839"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/hP2YIhdfVggmwaxjDlUxk"
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0
In-Reply-To <asa6qc100b4rr1jufdbllg4etgedc4rpr1@4ax.com>
Content-Language en-US
Cancel-Lock sha1:0K3f6YkblgvhoOOMlLTYACOfIu0=
Xref csiph.com comp.lang.java.help:4206

Show key headers only | View raw


On 8/27/2017 4:30 PM, IchBin wrote:
> On Sun, 27 Aug 2017 12:17:11 -0400, IchBin wrote:
> 
>> I have always had a hard time with regx. Even the simple things like
>> this one. All I want to do is replace a string with another string. In
>> this case a ' replaced with ''.
>>
>> I am trying:
>> rsNname = rsNname.replaceAll("\\d \\D \\W \\w \\S \\s", "''");
>> rsNname = rsNname.replaceAll("[+.-^]", "''");
>> rsNname = rsNname.replaceAll("[$&+,:;=?@#|'<>.^*()%!-]", "''");
>> rsNname = rsNname.replaceAll("['++]", "\\''");
>>
>> Nomatter what I do I get a compli error "Derefferencing pointer
>> error". Any one have any suggestions.
>>
>> I could write code to do the same but seems better to do in one
>> commane.
>>
>> Thanks in advance
> 
> Thanks but I fixed it. What I needed was
> 
> rsNname = rsNname.replaceAll("\''","''");

     This "replacement" is a no-op; it accomplishes nothing.
I'll repeat my earlier suggestion: Show us your code, and give
a careful description of what you're trying to do.

-- 
esosman@comcast-dot-net.invalid
Twelve hundred forty-two days to go.

Back to comp.lang.java.help | Previous | NextPrevious in thread | Find similar


Thread

Regx problem IchBin - 2017-08-27 12:17 -0400
  Re: Regx problem Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-08-27 15:17 -0400
    Re: Regx problem IchBin - 2017-08-28 09:13 -0400
  Re: Regx problem IchBin - 2017-08-27 16:30 -0400
    Re: Regx problem Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-08-27 16:53 -0400

csiph-web