Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong string replacement using regular expression with ^-sign (begin of line) #4525

Closed
mc-butler opened this issue Jan 29, 2024 · 7 comments
Closed
Assignees
Labels
area: mcedit mcedit, the built-in text editor prio: high Serious problem that could block progress ver: 4.8.27 Reproducible in version 4.8.27
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/4525
Reporter sabitov (mc@….pp.ru)

How to reproduce

1 Run mcedit and type in these lines:

111
112
113
114
115
121
122

2 Go to the beginning of the file and press F4
3 Fill in the form this way:

"Enter search string:" ^1
"Enter replacement string:" 7
(*) "Regular expression"

4 <OK> -> <All>

The correct result MUST be:

711
712
713
714
715
721
722

As a result you'll get this text:

777
772
773
774
775
721
722

That's wrong

This regex should to change only the first char in each line.

a) there are wrong changes at second char in lines 1-5
b) there is wrong change at third char in line 1
c) pay attention to the 6th and 7th lines. They are correct.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jan 29, 2024 at 16:03 UTC (comment 1)

  • Component changed from mcedit to mc-search

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jan 29, 2024 at 18:30 UTC (comment 2)

  • Version set to 4.8.27
  • Component changed from mc-search to mcedit

The bad commit is [21feb38].

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jan 30, 2024 at 18:43 UTC

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Feb 2, 2024 at 16:49 UTC (comment 4)

  • Owner set to andrew_b
  • Branch state changed from no branch to on review
  • Status changed from new to accepted
  • Milestone changed from Future Releases to 4.8.32

Branch: 4525_mcedit_replace_regex
Initial [147f28a]

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Feb 11, 2024 at 15:58 UTC (comment 5)

  • Branch state changed from on review to approved
  • Votes set to andrew_b

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Feb 11, 2024 at 16:03 UTC (comment 6)

  • Resolution set to fixed
  • Status changed from accepted to testing
  • Branch state changed from approved to merged

Merged to master: [a58e0a1].

git log --oneline c1832fd58..a58e0a1d6

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Feb 11, 2024 at 16:05 UTC (comment 7)

  • Status changed from testing to closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: mcedit mcedit, the built-in text editor prio: high Serious problem that could block progress ver: 4.8.27 Reproducible in version 4.8.27
Development

No branches or pull requests

2 participants