How to highlight entire line that contains asterisk* (Find&Replace)?

My document has lines like:

  1. some text*some more text
  2. some textsome more text

(Sometimes, I am missing the asterisk in a line.)

How can I Find&Replace(Format) all the lines that contain asterisk (or, even better ^Negative don’t contain asterisk*) and Format>Highlight them?

Use regex: ^[^*]*$

Note that “line” is not something that Writer can handle: it can’t find “automatic end of line”. So you only can operate on paragraph level. If your “lines” are paragraphs - then you are OK; otherwise, you would need e.g. hard line breaks, and use \n in the regex.

If your highlighting is intended to be part of the final formatting, you should consider incorporating it into the paragraph style or assign a character style to the sequence.

… and then it’s enough to find all asterisks (plain * in non-regexp mode, Find All), and apply the paragraph style.

Is paragraph style somewhere in Find&Replace, to do this? I don’t see it there.

The paragraph style cannot be applied with Find&Replace. The procedure to to “Find All” and leave the F&R dialog. What was selected remains selected. You then apply manually a paragraph or character style from the style side pane. Important: don’t click inside your text otherwise selection is reset.

Ok, thanks, I understand that now.

However, after doing this (it highlights all the asterisks* (I also made some extra-paragraph-spaced lines to test), and closing(also tried not closing) Find&Replace and going to Styles>Edit and applying Highlight (the asterisks* at this point are still selected) …

… it highlights all lines, including lines with no asterisk*.

By going to Edit>Styles, you’re modifying the paragraph styles of everything selected. It is then likely that all your paragraphs contains at least an asterisk and you consequently modify all involved styles, which is not the selective intent.

Prepare the paragraph or character style before F&R. Apply the style by a double-click in the side style pane.

If the all-highlighting persists, check twice your regexp. It may match too loosely.

Do you use line breaks instead of paragraphs by chance?