I have a Debian machine with Kate Version 16.08.3 .
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".
The documents give essentially no examples.
Help please.
TIA
This Appendix contains a brief but hopefully sufficient and
covering introduction to the world of regular
expressions. It documents regular expressions in the form
available within KatePart, which is not compatible with the regular expressions of perl, nor with those of for example
grep.
My web reading and a discussion in another forum has may has made me
aware that there is more than one way to handle regular expressions.
On Wed, 3 Jul 2024 05:57:39 -0500, Richard Owlett wrote:
My web reading and a discussion in another forum has may has made me
aware that there is more than one way to handle regular expressions.
The Perl style seems to have become something of a de-facto standard.
On 05.07.2024 03:05, Lawrence D'Oliveiro wrote:
The Perl style seems to have become something of a de-facto standard.
Hardly. First, there's differences on the functional level; Perl
supports with their regexp library functions that are not part of the
Regular Expression grammar class, they exceed that class. The
consequence is that for that subset there's no O(N) (linear) complexity guaranteed any more.
Second, there's syntactical differences between tools, that are
necessary to handle meta-characters in their specific language
context; in one tool meta-characters need, e.g., to be escaped where
in another context that's not necessary. How can something be a
standard when (standard-)tools do not support that.
Moreover, when speaking about [de facto] "standards"; what would
that mean in the light of existing (real) standards ...
On Fri, 5 Jul 2024 04:00:01 +0200, Janis Papanagnou wrote:
[...] First, there's differences on the functional level; Perl
supports with their regexp library functions that are not part of the
Regular Expression grammar class, they exceed that class. The
consequence is that for that subset there's no O(N) (linear) complexity
guaranteed any more.
Precisely. Many users of REs seem to feel it is useful to at least
have the option of such extensions, and they are willing to pay that
price.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 153:59:47 |
Calls: | 10,383 |
Files: | 14,054 |
Messages: | 6,417,842 |