Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.help Subject: Re: regex puzzle Date: Tue, 30 Oct 2012 14:16:29 -0700 Organization: A noiseless patient Spider Lines: 19 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 30 Oct 2012 21:16:31 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="61282af8d6595e8d991edb5ac03d6e00"; logging-data="11804"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19OUZ+UEiMbquJg25+FEptUNchj/JhimD0=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 In-Reply-To: Cancel-Lock: sha1:WGU3j2/XoDVRIIrGKb9qcVZbbiQ= Xref: csiph.com comp.lang.java.help:2202 On 10/30/2012 6:48 AM, Peter J. Holzer wrote: > > Java Regexps seem to be Perl-compatible, so > > s.replaceAll(""(\S*?)"", "$1"); > I don't think this will work, in the general case. What about input like: Hi"I'm-a"-dash-seperated-"string." You'll end up with one replacement, where I think Roedy would require two. However, that's a good point as Roedy didn't show any examples involving white-space. Some clarification beyond simple examples is in order, methinks.