Bug 499235

Summary: Possible Errors with Anchors: ^ $ \A \Z \z
Product: [Applications] krename Reporter: Michael Jenkins <ukmjenkins>
Component: generalAssignee: Heiko Becker <heiko.becker>
Status: REPORTED ---    
Severity: normal CC: ukmjenkins
Priority: NOR    
Version First Reported In: 5.0.1   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Michael Jenkins 2025-01-28 07:33:14 UTC
SUMMARY

The Anchors:
^ = Beginning of String (or Line).
$ = End of String (or Line).
\A = Beginning of String.
\Z End of String (or Before Optional Line Break).
\z = Very End of String.

STEPS TO REPRODUCE

I have a file with filename:
0000.0000.txt

(1) For Find and Replace, I can type:
Find = ^.
Replace = X

When I select "Okay",
the proposed filename appears:
X000.0000.Xtx
Is this correct or incorrect ?

Should the proposed filename be:
X000.0000.txt

(2) For Find and Replace, I can type:
Find = .$
Replace = X

When I select "Okay",
the proposed filename is:
0000.000X.txX
Is this correct or incorrect ?

Should the proposed filename be:
0000.0000.txX

(3) For Find and Replace, I can type:
Find = \A.
Replace = X

When I select "Okay",
the proposed filename is:
0000.0000.txt
Is this correct or incorrect ?

Should the proposed filename be:
X000.0000.txt

(4) For Find and Replace, I can type:
Find = .\Z
Replace = X

When I select "Okay",
the proposed filename is:
0000.0000.txt
Is this correct or incorrect ?

Should the proposed filename be:
0000.000.txX

(5) For Find and Replace, I can type:
Find = .\z
Replace = X

When I select "Okay",
the proposed filename is:
0000.0000.txt
Is this correct or incorrect ?

Should the proposed filename be:
0000.0000.txX

OBSERVED RESULT

I have tested these 5 anchors several times.
The results are always the same,
which I have described above.

Please Help.

EXPECTED RESULT

SOFTWARE/OS VERSIONS
Xubuntu 22.04 LTS

ADDITIONAL INFORMATION
7.30am Tuesday 28 January 2025.