Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: any find and replace one-pass algorithm processing multiple strings at once? Date: Mon, 29 Sep 2014 20:37:12 -0400 Organization: A noiseless patient Spider Lines: 24 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 30 Sep 2014 00:37:12 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="bd4e1cba8d8592bec5d5ed9e4537fbfd"; logging-data="8270"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/KS81qdt3NL+w3l41C0Zj9" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 In-Reply-To: Cancel-Lock: sha1:T/j5RjqGFrotFMXZ3yeICLmVHOA= Xref: csiph.com comp.lang.java.programmer:30035 On 9/29/2014 7:52 PM, JKdr wrote: > > Probably "Yes," given suitable preconditions. > > The only input I think is needed is an input stream and its encoding > > > Lacking them, probably "No." > > I spent some time trying to find an implementation of such a thing, > which I think shouldn't be a big deal at least in the case that you > don't use regex, just strings to find ... > > It seems, Java's implementations of matchers touch the string more > than once (I have run a few tests buffering the file into char arrays > the monkey way) > > I think the data strat of such an algo is based on a graph/decision > tree, which are used in state machines and such things > > Unless I am missing something That's a possibility. I repeat: pisppmd. -- esosman@comcast-dot-net.invalid