'.+' as a regex not working in Find & Replace

Version: 7.6.4.1 (X86_64) / LibreOffice Community
Build ID: 60(Build:1)
CPU threads: 2; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: en-US (en_US.utf8); UI: en-US
7.6.4-1
Calc: threaded

4-45

Search as on picture attached results in error. Actually I don’t find the search string to be erroneous. In this particular case it is not possible to invoke Find Next.

EDIT
As for current case it was possible to find target manually. But in the future this way may be not feasible. How to resolve?

Works like a charm here: Fedora 39, KDE Plasma desktop, LO 7.6.5.2

Good to know, thanks. Does this function need for operating system package management to have installed some package with regex implementation?
I find no references to terms ‘regex’, ‘regular’ in 7.6.5 RC1/RC2 Release Notes. Hence it is not the delta 7.6.4 to 7.6.5.

You don’t need any extra package. Regular Expressions (ICU flavor) are integrated into LibreOffice from the beginnig (V 3.3).

Your image already tells: “Search key not found”. So why should there be an option to “Find Next”? Or: if there is, why do you expect another outcome?

You’re right!
Anyhow, the red color of field Find is annoying - may “Search key not found” be result of previous search for different string?

Interestingly, if to search document for words printed in italic manually I find at least one match.

Remove the leading space from the Find field

If the italic is the result of choosing Emphasis character style (a good practice), the text would’t be found.
See '.+' as a regex not working in Find & Replace - #22 by bugreporter2024

1 Like

I tested it in my machine and it works just fine. I was able not only to search for the Italic formatting with the .+ expression but also without any regular expression. An empty search string is valid when looking for formatting only, apparently.
But Format Search only works for finding direct formatting. Formatting applied through paragraph/character styles result in a failed search: “Search key not found.”
The word consectetur was formatted directly while the word Donec and the second to last paragraph used character and paragraph style, respectively.

Right for character styles but wrong for paragraph styles. To search for paragraph styles, tick the Paragraph styles check box and enter the style name in Find:.

If you want to find occurrences of Italic words or paragraphs formatted using paragraph or character styles (as well as directly formatted), check the box “Including Styles” in the F&R dialog, under Other options, after you select Italics in ‘Format…’

seems like the behaviour on an empty doc ? :thinking:

There are eight pages in document.

You have “italic” chosen as searched-for formatting.

That’s true. I want to find all occurrences of such as I need to find the name of assigned character style.

So the question is - does it work without format? And then, without the document, it’s hard to guess which formatting may give this result.

I bet that the premise about regex being the problem is wrong.

1 Like

No search criteria - nothing to do for F&R, functionality completes immediately, shortcut.

What could this phrase possibly mean?
“No search criteria” - who asked to check “no search criteria”? The question was if searching only the regular expression, but without the “italic” constraint, worked. Having a regex is definitely a valid search criterion.
You are on an international user-to-user help site. It is nice to write complete sentences, like “when I click on this button, and delete this from the Find box, then press Find button, I see this message box appearing…”, instead of the cipher quoted above, which might be interpreted in a multitude of ways.

1 Like

Regular expression is in this particular case a helper because Writer doesn’t support searching for merely formatting attributes. Sure, the regex alone in Find&Replace dialog works fine, this doesn’t help however for my search. The formatting Italic is this search only objective. In this particular case some words typed in Italic got appropriate character style assigned (it is what sets the Italic attribute). If to select adequate option in F&R dialog the search results in expected matches - a regex is not needed at all in this case. Hadn’t the words the mentioned character style got assigned, anyhow typed in Italic, it wouldn’t be possible to find them.

It doesn’t matter what your objectives are. You came asking for help. In order to diagnose the problem, you were asked very specific questions. Again: you weren’t told “doing thusly is the solution”; the question was - at which step the problem appears: does one part without the other work. It was even told to you, that there will be a next step, requiring a sample document.

But you decided to ignore the very clear diagnostic steps, and answered something else. Fine then, your choice. Bye.

1 Like