Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: Regexp exception in String.replaceAll Date: Wed, 26 Sep 2012 14:31:36 -0700 Organization: A noiseless patient Spider Lines: 16 Message-ID: References: <7ku568loa4ogik4e6asouundcbcjurg6lj@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 26 Sep 2012 21:31:37 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="61282af8d6595e8d991edb5ac03d6e00"; logging-data="20077"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+vzDMLzENXVnn/CcQNjKtSUVzp3L0WrPg=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 In-Reply-To: Cancel-Lock: sha1:CDPmVC4ZXLyKxFY6TrM5naFh+sA= Xref: csiph.com comp.lang.java.programmer:18959 On 9/26/2012 1:27 PM, Daniel Pitts wrote: > On 9/26/12 12:26 PM, Daniele Futtorovic wrote: >> To be a little pedantic myself and for the record, I don't think the >> quoting of a Pattern and the quoting of a replacement string are the >> same type of quoting. > Indeed, Pattern.quote is for quoting the pattern, and > Matcher.quoteReplacement is for quoting the replacement. The OP should > be using both. Nope that's what I get for not paying close attention to what's being discussed. Correct on both counts!