<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - EDITING: Find & Replace Backreference Fails using Replace All and \b"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=107916">107916</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>EDITING:  Find & Replace Backreference Fails using Replace All and \b
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>5.2.6.2 release
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Writer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>rink92@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In certain situations, using a regex with groups and backreferences in Find &
Replace will cause the backreference to insert "$1" instead of the actual text.

Steps to Reproduce:
  In Writer:
    1.  In a document, insert the following text:
           .AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.
           .BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
           CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC.
           DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
    2.  In Find & Replace, use the following (with regex activated):
            Find: \b([0-9a-f]{32})\b
            Replace: $1
    3.  Note that hitting "Replace" will replace the strings of letters with
themselves as expected.  Then note that hitting "Replace All" will replace the
A and B strings with the text "$1".

Replace all results in Writer:
           .$1.
           .$1
           CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC.
           DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD

Libreoffice Calc performs the "Replace All" as expected:
           .AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.
           .BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
           CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC.
           DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>