Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Andreas Leitgeb Newsgroups: comp.lang.java.programmer Subject: Re: regex replaceAll? Date: Thu, 1 Mar 2018 21:55:44 -0000 (UTC) Organization: A noiseless patient Spider Lines: 16 Message-ID: References: <4a800440-39fe-4684-8369-e6a4e6b9d79f@googlegroups.com> <44c665e1-e965-4e9b-8aa0-72aa20607e63@googlegroups.com> Reply-To: avl@logic.at Injection-Date: Thu, 1 Mar 2018 21:55:44 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="807d901ffb0722c07d9ed77f22fa844a"; logging-data="19243"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+REydAkrOB3iOs1mOlS2BE" User-Agent: slrn/1.0.2 (Linux) Cancel-Lock: sha1:DNG9TqMCrok1yDtBvl2mpJufWxs= Xref: csiph.com comp.lang.java.programmer:38096 Eric Douglas wrote: > On Thursday, March 1, 2018 at 2:03:47 PM UTC-5, Andreas Leitgeb wrote: >> [.] only matches a literal dot. That might be the root-cause of why it's >> not working the way you like. > The Pattern says the dot matches anything, but I tried many many variations. I leave it to you, to write some test prog trying to replace all "[.]" by e.g. "_", and doing that on a string like "abc.def.123". Once you then go on to replace all the "[.]" by simple "." in your RE (there were two of them, iirc), then you might indeed still see an unwanted result, but maybe, looking at that new one might hint you towards the next mistake. If it doesn't, feel free to post a followup with the updated pattern, in, spec and out strings.