Description: Search string is (With Regular Expresson set ON):- “((\s)|(^))(that)((\s)|([.,!?:;'\"\'-]))” Replace string is: “$1not$3" Text is:- that this and that this and that ok result should be:- not this and not this and not ok but result is:- notthatthis and notthatthis and notthatok Steps to Reproduce: 1.Enter following text in writer: "that this and that this and that ok " 2.In Search & Replace-->Search string is (With Regular Expresson set ON):- “((\s)|(^))(that)((\s)|([.,!?:;'\"\'-]))” 3.Replace string is: “$1not$3" 4.result should be:- "not this and not this and not ok " 5.but result is:- "notthis and notthis and notok " (using safe mode) Actual Results: "notthis and notthis and notok " Expected Results: "not this and not this and not ok " Reproducible: Always User Profile Reset: No Additional Info: This is happening all the time when more than 1 parameter in replace text is used ... e.g. $1$3.
Result is: "notthis and notthis and notok " (in safe mode). Result is: "notthatthis and notthatthis and notthatok " without using safe mode
NOT A BUG for me. The Find string must be: "(\s|^)(that)(\s|[.,!?:;'\"\'-])". Original text: "that this and that this and that ok " Result text: "not this and not this and not ok " Version: 7.3.7.2 (x64) / LibreOffice Community Build ID: e114eadc50a9ff8d8c8a0567d6da8f454beeb84f CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: default; VCL: win Locale: es-MX (es_ES); UI: en-US Calc: CL
I could reproduce with LO 7.2.7, but not with LO 7.3.7 nor LO 7.4.4 nor LO 7.5alpha, in all of which the result correctly is "notthis and that this and that ok " Note that the capture groups may not be what you think they might be: group1: ((\s)|(^)) group3: (^) Anyhow, what platform and LibreOffice version anyway? Please copy-paste the Version Information from the Help -> About LibreOffice dialog.
Or sorry, out of habit I tried in Calc that does not repeat a match on found strings, actually I can reproduce in Writer even with LO 7.4.4 and using ReplaceAll, but note what is found with a FindAll, all " that ". Anyhow, my capture group remark still is valid.
Thanks LeroyG for your comment.... "(\s|^)(that)(\s|[.,!?:;'\"\'-])" does do the trick. So this is not a bug! It was my faulty REGEXP. Thanks again LeroyG Thank you all for your kindness to reply. I am sorry to have take up your precious time. I am marking this report as resolved.