Path: csiph.com!news.mixmin.net!aioe.org!XakcSTEO51npqVb7OVl71w.user.46.165.242.75.POSTED!not-for-mail From: "R.Wieser" Newsgroups: comp.lang.javascript Subject: Re: trying to match a "word", having difficulty with a "Lookbehind assertion" Date: Thu, 16 Jun 2022 21:18:31 +0200 Organization: Aioe.org NNTP Server Lines: 54 Message-ID: References: <628b4693-e733-4d3d-bd00-8ab522e92262n@googlegroups.com> <5844f300-546d-48a5-884f-f10c2078b084n@googlegroups.com> <0ac3789b-098e-4787-96c2-c5dd07b7629dn@googlegroups.com> <6f36fa56-ab24-4ddc-9040-ea3c178b1546n@googlegroups.com> Injection-Info: gioia.aioe.org; logging-data="57877"; posting-host="XakcSTEO51npqVb7OVl71w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org"; X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 X-Priority: 3 X-RFC2646: Format=Flowed; Original X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-Notice: Filtered by postfilter v. 0.9.2 Xref: csiph.com comp.lang.javascript:40912 Scott, >> Ask yourself : does your approach solve the "this is a clbuttic mistake" >> problem ? ... > I don't think that anything can comfortably reverse the clbuttic > mistake. Than start with thinking how *not* to make it. 'Cause /that is all/ what my problem is about. I've already tried to explain it, but here it goes again : * * * * * * * * * * * * * * When I'm replacing all instances of "ass" in a piece of text I DO NOT WANT to see "classic" being converted into "clbuttic". * * * * * * * * * * * * * * Replace "ass" with "d***" and "classic" with "g**d***" and you have my example of two posts back. > What I think you're doing is trying to find a way to reverse the manual > censoring of, say, `g**d***` which is too unlikely to be intended text, > and > restore `goddamn` Manual or not, yes, that is indeed what I'm doing ... .... And *not at all* what my question is about. > No, but there is are different ways to answer the questions, "How do I > solve this real world problem?" and "How can I best use regex to solve > this problem?" The problem with the above is that you are second-guessing what I "really" want to know. Don't. > Finally, here's another attempt, using a combination of a negative > look-behind before the target and a negative look-ahead after it. Sigh. Look at the subjectline. What does that tell you ? Also take a quick peek at the last few lines of my second message. Regards, Rudy Wieser