Description: LibreOffice has developed into a very complex software, yet the Find and Replace feature, which I use often, is still very basic. I would appreciate if you could dedicate some attention to enhance its features. Some examples: 1. Search all text in bold and set them to Heading 2 paragraph style 2. Search for line in bold and its subsequent line and replace line 1 as Heading 1 and line 2 as Heading 2 3. Match Heading 1 text and prepend the text "Chapter " 4. Help can be offered offered in building complex regular expressions by presenting a drop-down list with options of strings to match Steps to Reproduce: 1. Open Find and Replace 2. select "Regular expressions" Actual Results: The four examples mentioned in the description above are not offered. Expected Results: It is not possible to perform tasks 1-3 through the current interface, at least for the common user. Reproducible: Always User Profile Reset: No Additional Info: It would be nice to be able to perform these tasks that go beyond text manipulation to include formatting marks: (bold, italic, underline, ... ) and the application of styles (paragraph/character). This could be done through the enhanced use of regular expressions, with the capability to match formatting data and styles (paragraph and character)
One issue per report. Also, quite probably some or all of your requests are already covered by existing reports. I bet the style stuff is covered by the reports in this meta: https://bugs.documentfoundation.org/showdependencytree.cgi?id=106876&hide_resolved=1 Also see [META] Find & Replace Regular Expressions https://bugs.documentfoundation.org/showdependencytree.cgi?id=146076&hide_resolved=1 [META] Quick Find, Search and Replace https://bugs.documentfoundation.org/showdependencytree.cgi?id=102847&hide_resolved=1 [META] Find & Replace Dialog https://bugs.documentfoundation.org/showdependencytree.cgi?id=113136&hide_resolved=1 Setting to needinfo while you figure it out.
Only the first point has been requested in the lists provided. Point 4 has been requested for special characters, I hereby requested it to aid in building Regex. Points 2 and 3 remain unique. Point 2 rests, however, two another issues: 1)that of being able to select an end of paragraph and the following text, and 2) replacing with a paragraph style (still in progress) If you tell me that it is better to initiate different requests I can do that. Since this is a feature request of what I consider to be related items I did not want to add many requests.
(In reply to Walter from comment #0) > 2. Search for line in bold and its subsequent line and replace line 1 as > Heading 1 and line 2 as Heading 2 > 3. Match Heading 1 text and prepend the text "Chapter " Both of these could basically be summed up as "allow targeting of styles and formatting via regular expressions", which seems quite ambitious. It would mean adding new non-standard regex syntax. I'll change the summary accordingly. That said, the AltSearch extension already seems to offer what you want: https://extensions.libreoffice.org/en/extensions/show/70066 https://macrojtb.hys.cz/HelpAltSearch_en.html List box 'Properties' This enables searching according to properties (attributes), and also according to the values of these properties. The search entry must begin with the string [:::, followed by a name of a property (more than one name can be separated using the | sign) and must end with the string ::]. After this can follow the specification of some search text. If the value of the property is to be searched, the construction name=value should be used. [:::ParaStyleName::] - searches for paragraph style [v1.3.1] [:::ParaStyleName=::] will find all whole paragraph with paragraph style another than the Default style [:::ParaStyleName=Example::] will find whole paragraph with paragraph style Example [:::ParaStyleName=Example::] something will find text something if it is formatted through paragraph style Example etc. > 4. Help can be offered offered in building complex regular expressions by > presenting a drop-down list with options of strings to match I guess the design team can mull over this one as well and the potential splitting of the report can be done after the decision.
1. If you talk about "text in bold" it rather sounds like a word which would be a character style then (bug 78582). 2. I don't understand the term "line", probably you mean paragraph and it is possible to search for and replace paragraph styles. 3. Amend any text with a certain paragraph style with some text is a bit far fetched and I doubt it is based on a real use case. Besides, how about doing this via list style? 4. Yes, support is always good You ticket actually boils down to "improve regular expressions", which is tracked in bug 38261. Do you agree with a duplicate?
(In reply to Heiko Tietze from comment #4) > 2. I don't understand the term "line", probably you mean paragraph and it is > possible to search for and replace paragraph styles. Not enough in this case as the subsequent line can be of any formatting. So you would need an AltSearch type of system.
(In reply to Heiko Tietze comment #4) I acknowledge that most of the feature request I made has already been mentioned in bug 38261, including enhancement or LO's regex possibly by endorsing AltSearch extension. The end-of-paragraph issue is also mentioned, which for me would be important to address. I receive plain text files on a regular basis and I need to format them with styles. RegEx is very handy to me to do these tasks.
Please note that in AltSearch outputting different paragraph styles is not consisent. In my case: Find: (.+):(.+) Replace: \P{Heading 1}\1\p\P{Heading 2}\2 The output is that both sections of text are marked as being Heading 2
We made similar tickets such as bug 139585 a duplicate of bug 38261, which is treated as a META bug however. I'm not sure anymore that we should make the F&R feature more complicate to use as this workflow could be solved via extensions like AltSearch (https://extensions.libreoffice.org/en/extensions/show/70066).
(in reply to comment 8) AltSearch depends on LO. Two issues that limit AltSearch are: 1. Searches do not go beyond end of paragraph. Therefore text1$text2$2text3 is impossible to search. 2. Output of Text 1 at Heading 1\nText 2 and Heading 2 is not possible either. Moreover, I do think that it would be a good think that LO offers native support for these features, rather than relying on an extension who's support is beyond LO itself.
We discussed this topic in the design meeting. While there are a lot use cases imaginable, text processor are typically not the tool for regular expressions. Users just should not expect complete functionality compared to alternative solutions. Extensions are a good way to involve 3rd party contributors into the development, which should be preferred here. This should not be understood as a rejection - improvements to regex are welcome. => duplicate *** This bug has been marked as a duplicate of bug 38261 ***
(In reply to Heiko Tietze from comment #10) As one of the two people who were in that discussion, there are two important points that I believe need to be made. First is, that LibreOffice must make it fully possible for extensions to offer such functionality; and it seems, from Walter's last comment, that this is not the case. It should also be possible to introduce functionality without having to play catch with existing dialogs, and have to implement a whole lot, yourself; extension authors need to be able to piggy-back over what's already available. The second point is the extent of interest in such functionality. This is always difficult to tell looking at a single bug. But - something I did not do before hesitantly agreeing with the closure is look at the bug of which this is now marked as a dupe. But then - Walter, you haven't done that either. Regis Pedrau has also commented, on the design mailing list, that > in find and replace, we ask for ages to be able to replace end of paragraph > by end of line.
(in reply to commet 10) I understand your reasoning that LO should not necessarily offer full Regex support, given that this can be done through extensions. I can give a helping hand tlin developing an extension if I am offered help about ODT document structure ecc. (in reply to comment 11) Regards the duplicate, I have gone through the various bugs and commented upon them in (6,7 & 9). Otherwise I have not understood what you are referring to. Regards the new line and existing search limitations (comment 9), it is not my competence to suggest if they can be tackled on the level of an extension or else if it needs to be catered for at the app level.
I believe an actual exact dupe of this bug is 119728,
(In reply to Walter from comment #12) > I can give a helping hand tlin developing an extension > if I am offered help about ODT document structure ecc. Of course you get full support. You may ask any questions at the dev IRC channel (check the wiki for the address) and we have a Telegram group for Macros & Scripting. I'd suggest to get in contact with the original author of AltSearch as it appears not to be very active anymore. And you can always start a new project. Besides, no one hinders you to contribute to the core. If you want to volunteer you may improve any aspect of regex. (In reply to fpy from comment #37) > - I'm a little concerned with the "off-topic" tags since this bug was (at > least partly) about improving the documentation. cf #c30 What exactly is missing? https://help.libreoffice.org/latest/en-US/text/shared/01/02100001.html
(In reply to Heiko Tietze from comment #14) > (In reply to fpy from comment #37) wow! nice on a closed bug I wasn't in CC of !! ;) > > - I'm a little concerned with the "off-topic" tags since this bug was (at > > least partly) about improving the documentation. cf #c30 > What exactly is missing? - the fact that some extensions are "officially" recommended. AltSearch and ... ? - what status is given to them, a sort of TDF blessing ? (a git repo? bugtracking? ...). or do we go "use at your own risks" ? > I'd suggest to get in contact with the original author > of AltSearch as it appears not to be very active anymore. And you can always > start a new project. first step should be to translate the comments in there ;)
(In reply to fpy from comment #15) > wow! nice on a closed bug I wasn't in CC of !! ;) Sorry, didn't check whether you are on CC. Commenting here to prevent too much noise on the other ticket. > - what status is given to them, a sort of TDF blessing ? This sounds wrong to me. TDF supports the development of LibreOffice but ultimately it's an open source project. If you disagree with the opinion to "not request full functionality" feel free to reopen this ticket. And volunteers are always welcome! > first step should be to translate the comments in there ;) Please be more specific. You also may join the effort yourself. Localization is done on https://translations.documentfoundation.org/ with more info on https://wiki.documentfoundation.org/Language
(in reply to Heiko Tietze comment #14) I have contacted the developer of AltSearch, who gave me the permission to develop on his extension. He is not doing any further development himself. Regards the issue I presented in comment 7 the solution is in the order: Find: (.+):(.+) Replace: \1\P{Heading 1}\p\2\P{Heading 2} Therefore this point is technically solved.
(In reply to Walter from comment #12) > (in reply to comment 11) > Regards the duplicate, I have gone through the various bugs and commented > upon them in (6,7 & 9). Otherwise I have not understood what you are > referring to. I mean, that it's important to get an understanding of what people have been complaining about, and asking for, and try to focus their interest on a concrete suggestion in the direction you feel is beneficial. But if you're able to engage in development work, that changes things. Note also that Laszlo Nemeth may be starting some related work, in bug 165931. His interest is not in styles, but his approach to supporting special indicators in match patterns may be relevant.
(In reply to Walter from comment #17) > (in reply to Heiko Tietze comment #14) > I have contacted the developer of AltSearch, who gave me the permission to > develop on his extension. He is not doing any further development himself. If you feel confident enough I can make you the maintainer of this extension.