| Summary: | Regular expressions containing ^ or $ should be matched only once per line | ||
|---|---|---|---|
| Product: | [Applications] kate | Reporter: | Christoph Bartoschek <bartoschek> |
| Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | groszdanielpub, waqar.17a |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | openSUSE | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Christoph Bartoschek
2007-03-06 15:14:05 UTC
This sounds like a duplicate of another repeated-replacing bug. Also since searching was re-implemented in between I think this bug can be closed. I don't know if this really has been fixed at some point, but it has the broken (or at least unexpected) behavior again. It also happens with other assertions: if e.g. you replace "(?<= )." with "", it removes everything after the first space, rather than only the first character after each space; likewise, if you replace "\b\w" with "", it removes every word character, rather than just the first character of each word. My guess as to why this happens is that in each replacement step, Kate first preforms a replacement, then moves the cursor to the end of the replacement text (which is empty in our examples), and then performs the next search beginning from there. Instead, when using Replace All, it should first find all instances to replace, and then perform all the replacements. This is what other regex replacement engines seem to do, such as those of sed and javascript (at least in effect; I don't know how they are implemented). When using the Replace button, it should probably take into account the result of previous replacement, but not the current replacement, when finding the next occurrence of the search string. Not reproducible with latest master. For new bugs => new reports. Lets let the old ones rest. (In reply to Waqar Ahmed from comment #3) > Not reproducible with latest master. For new bugs => new reports. Lets let > the old ones rest. Still reproducible with 22.04.2 as well as the latest master (da4b519d2). I opened a new bug report (Bug 455995). |