| Summary: | Find & Replace - the \t wildcard is not parsed as a replacement string for some Find instances | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | shcothran |
| Component: | Writer | Assignee: | Justin L <jluth> |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | CC: | aron.budea, dani3l.grigoras, erack, ikoll, jluth, michael.stahl, Nick_Levinson, rgb.mldc, vsfoote |
| Priority: | high | ||
| Version: | 3.3.0 release | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: |
https://bugs.documentfoundation.org/show_bug.cgi?id=106137 https://bugs.documentfoundation.org/show_bug.cgi?id=130480 |
||
| Whiteboard: | target:6.1.0 target:6.0.2 | ||
| Crash report or crash signature: | Regression By: | ||
| Bug Depends on: | |||
| Bug Blocks: | 38261, 102847, 113136 | ||
|
Description
shcothran
2016-09-22 20:48:07 UTC
Confirmed on 5.1 and 5.2: \t on the "replace by" box with RegExp enabled gives a \t instead of a tab. Other RegExp still work on "replace", like \n, but \t does not even if help says it should https://help.libreoffice.org/Common/List_of_Regular_Expressions Same problem found in version Version: 4.2.8.2 Build ID: 420m0(Build:2) also noticed that if I go to replace ;$ (semicolon followed by eol) with ; (semicolon space) it will replace semicolon eol with space eol, leaving the EOL. The \t as a replacement seems does work. Except... It seems like using the very common "^$" regex match of an empty paragraph puts the search into a mode where the \t does not get parsed. That makes Finding an empty string paragraph as target, and replacing with a string containing a \t <Tab> rather hard. *** Bug 107429 has been marked as a duplicate of this bug. *** This will require some kind of hacky programming to fix. "$" and "^$" are definitely edge cases. -sw/source/core/crsr/findtxt.cxx:DoSearch() - if it fails, then checks for three special searches const bool bChkEmptyPara = bRegSearch && 2 == rSearchOpt.searchString.getLength() && ( rSearchOpt.searchString == "^$" || rSearchOpt.searchString == "$^" ); const bool bChkParaEnd = bRegSearch && rSearchOpt.searchString == "$"; proposed hack: https://gerrit.libreoffice.org/49387 Justin Luth committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=9bb369edf5471d0b29b5cea86d7203831f93d529 tdf#102374: regex allow ReplaceBackReferences for $ search It will be available in 6.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. Justin Luth committed a patch related to this issue. It has been pushed to "libreoffice-6-0": http://cgit.freedesktop.org/libreoffice/core/commit/?id=5054456a6ed8ef7cd2a05fb09e1954eb02eaf0f7&h=libreoffice-6-0 tdf#102374: regex allow ReplaceBackReferences for $ search It will be available in 6.0.2. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. *** Bug 91033 has been marked as a duplicate of this bug. *** *** Bug 112575 has been marked as a duplicate of this bug. *** |