Deutsch   English   Français   Italiano  
<v61504$1mdqj$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com>
Newsgroups: comp.editors
Subject: Re: Confused first time Kate user
Date: Tue, 2 Jul 2024 17:05:40 +0200
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <v61504$1mdqj$1@dont-email.me>
References: <v613h1$1m6k5$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 02 Jul 2024 17:05:41 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="95ac446ead4ad37b8ba8161305ac805b";
	logging-data="1783635"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX180MlwrDGzVwS+WVopEcGqo"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
Cancel-Lock: sha1:y/DugntVX3A9LrtugIaPhYvSil0=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <v613h1$1m6k5$1@dont-email.me>
Bytes: 2594

On 02.07.2024 16:40, Richard Owlett wrote:
> I have a Debian machine with Kate Version 16.08.3 .

Disclaimer: I don't know the Kate editor. But I know Regular
Expressions (RE).

> 
> I wish to do a search & replace using regular expressions.
> The "Help" menu has led to
> https://docs.kde.org/stable5/en/kate/katepart/regular-expressions.html
> and
> https://docs.kde.org/stable5/en/kate/katepart/regex-patterns.html
> 
> I have strings of the form "XYZn" where n is one to three digits
> representing values of from 1 to 299. I wish to replace all occurrences
> with "abc".

You may do that with simple patterns if you don't have, say,
strings like XYZ300 that shall be disregarded. Then the RE
may simply be  XYZ[0-9]+  meaning any string XYZ that is
followed by an arbitrary number of digits. Instead you can
specify digits as optional  XYZ[0-9][0-9]?[0-9]?  or define
the amount of digits (1-3) explicitly  XYZ[0-9]{1,3}  which
still allows numbers out of range 1..299 (say, 0, 300) or
undesired syntaxes like 00 or 000. - Not sure it matters in
your case. If it matters, you can define alternatives with
a bar-symbol, e.g.,  XYZ([1-9]|[1-9][0-9]|[1-2][0-9][0-9])
that you group with parenthesis.

Where you put such regular expressions in your Kate editor
is known to you, I suppose?

> 
> The documents give essentially no examples.

Regular expressions may first appear confusing, but the links
you posted actually has relevant examples.

> 
> Help please.
> TIA

Hope that helps.

Janis