Suppose we want to search the word Hello for only two times side by side in a line and we write a regex (?:Hello){2}
Now we have 4 lines below:
Hello World
HelloHello World
HelloHelloHelloHello World
HelloHelloHelloHelloHelloHello World

The output for the regex (?:Hello){2} will be
Hello World
HelloHello World
HelloHelloHelloHello World
HelloHelloHelloHelloHelloHello World

But our as per our need we only want get one or more lines where Hello occurs only two times. That means only the second line ( HelloHello World ) should be matched.
Solution:
For that we can write the below regex

\b(?:Hello){2}(?=\s|$)

Output:
Hello World
HelloHello World
HelloHelloHelloHello World
HelloHelloHelloHelloHelloHello World

Explanation of regex:
\b : Represents Hello{2} that is HelloHello as a whole word. (\b is word boundary).
(?: : Represents the starting of non-capturing group.
Hello : Represents the actual word to match.
) : Represents ending of the non-capturing group.
{2} : Matches the word Hello two times consecutively.
(?= : Represents the starting of positive lookahead.
\s : Matches any whitespace character like space, tab, newline etc.
| : Represents an ‘OR’ operator.
$ : Matches the end of the string.
) : Represents ending of the positive lookahead.

Check link https://defineway.com/awesome/software-engineering/web/what-is-12-etc-in-regex/ to know about {1},{2}.. etc.