Ticket #4525 (closed defect: fixed)

Opened 9 months ago

Last modified 9 months ago

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

Reported by: sabitov Owned by: andrew_b
Priority: critical Milestone: 4.8.32
Component: mcedit Version: 4.8.27
Keywords: Cc:
Blocked By: Blocking: #4526
Branch state: merged Votes for changeset: andrew_b

Description

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.

Change History

comment:1 Changed 9 months ago by andrew_b

  • Component changed from mcedit to mc-search

comment:2 Changed 9 months ago by andrew_b

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

comment:3 Changed 9 months ago by andrew_b

  • Blocking 4526 added

comment:4 Changed 9 months ago by andrew_b

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

Branch: 4525_mcedit_replace_regex
Initial changeset:147f28ab24bf69a3465ae752f89da34ea0bf74b2

comment:5 Changed 9 months ago by andrew_b

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

comment:6 Changed 9 months ago by andrew_b

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

Merged to master: [a58e0a1d6182beadec7d2db1f434082fb9744719].

git log --oneline c1832fd58..a58e0a1d6

comment:7 Changed 9 months ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.