I have created a RegEx code to find the following:
- strings, or parts of strings (at least 5 consecutive words), that appear at least twice in the whole scope of text
- the whole scope of text is in tables.
/\b([\w]{1,}[\s]{1,}[\w]{1,}[\s]{1,}[\w]{1,}[\s]{1,}[\w]{1,}[\s]{1,}[\w]+)(?=.*\b\1{1,})/gm

I only used this part of the RegEx, since LibreOffice does not want to recognize the whole RegEx above:
\b([\w]{1,}[\s]{1,}[\w]{1,}[\s]{1,}[\w]{1,}[\s]{1,}[\w]{1,}[\s]{1,}[\w]+)(?=.*\b\1{1,})
The problem:
- the RegEx ONLY finds parts of a text that appears IN THE SAME segment, but not intersegmentally. The whole text is in scope.
The red underlined text (the one I underlined) in the right segment should also be found, but it was not. IOW: I want to mark duplicates even if they appear somewhere else in the document/another cell.

I have tried ChatGPT in OpenAI, but to no avail.
Please, help. I also use MS Word, so wildcards are also ok.
According to https://help.libreoffice.org/latest/en-US/text/swriter/guide/search_regexp.html:
But with plain text, there's no need to limit yourself to LibreOffice. For example, there are text editors such as Vim, command line tools such as grep, or programming languages such as Perl (or modern languages such as Python that use the same concept with a bit more code required).
For a solution that doesn't require anything in particular on your system, use the following web site (the example is included in the link): https://regex101.com/r/pF3EN3/1
In that example, I used the following regex:
The important part is the
/sflag at the end, meaning that the input will be treated as a single line so that.matches line breaks.