Bug 47659

Summary: EDITING: Search&Replace with Regexp fails on multiple match
Product: LibreOffice Reporter: Ninj <ninj>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: ninj
Priority: medium    
Version: 3.5.0 release   
Hardware: x86-64 (AMD64)   
OS: Windows (All)   
Whiteboard: BSA
Crash report or crash signature: Regression By:

Description Ninj 2012-03-21 07:42:10 UTC
Problem description: 
When searching with regexp, and replacing (all) using references ($1...), if the string of a cell has multiple matches, only the first replacement works. Following ones fail because the replacement reference is incorrect.

The problem only occurs with "replace all".

Steps to reproduce:
1. In a cell, enter this string: "123_456"
2. Open the search box, check "regular expressions", and enter the following:
Search: ([:digit:]{3})
Replace: $1
3. Click "Replace all"

Current behavior:
The value of the cell becomes 123_123

Expected behavior:
The value of the cell should be 123_456

NOTE: the original case in which the bug was found was more complicated and leaded to even more weird results. Here it is in case it helps:
http://nabble.documentfoundation.org/Calc-Bug-in-Search-replace-with-regexp-tc3844337.html

Platform (if different from the browser): 
Windows 7 64bit
              
Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0
Comment 1 Timur 2012-04-09 02:49:29 UTC
This looks like a duplicate of Bug 44861.

*** This bug has been marked as a duplicate of bug 44861 ***