Path: ...!weretis.net!feeder9.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail From: gazelle@shell.xmission.com (Kenny McCormack) Newsgroups: comp.editors Subject: Re: Confused first time Kate user Date: Wed, 3 Jul 2024 11:46:26 -0000 (UTC) Organization: The official candy of the new Millennium Message-ID: References: Injection-Date: Wed, 3 Jul 2024 11:46:26 -0000 (UTC) Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4"; logging-data="3161965"; mail-complaints-to="abuse@xmission.com" X-Newsreader: trn 4.0-test77 (Sep 1, 2010) Originator: gazelle@shell.xmission.com (Kenny McCormack) Bytes: 2085 Lines: 27 In article , Richard Owlett wrote: .... >> This regex expression should do what you want: >> [[:digit:]]{3} >> > >I suspect that would accept a value of "0". >*ERROR* with results I don't wish to contemplate. I suspect that what you want to do actually can't be done (accurately) with regexps, if we interpret your requirements literally. Most responders so far have pretty much glossed over your requirements. For example, while you want to match (and replace) XYZ299, you want to leave XYZ300 alone. You probably need a programming languages (such as AWK) to do this correctly. Note, BTW, that the real problem with regexps is that there are so many different implementations. Supposedly, there is a standard - actually, multiple standards - but each implementation is subtly different. For example, sometimes you need \ before special characters like ( or { or ? and sometimes you don't (depending on which implementation you are using). -- "If our country is going broke, let it be from feeding the poor and caring for the elderly. And not from pampering the rich and fighting wars for them." --Living Blue in a Red State--