When we search a pattern one or more time we use ‘*’. But Sometime we want to search a character or a pattern for a specific number of time. Then we can use {1},{2}… etc.
Syntax of this is pattern{2}
This pattern will match exactly 2 times.

Let’s see an example for better understanding.
We have two lines below and we want to fetch two times ‘thankYou‘, not less than two.

thankYouthankYou so much.
thankYou so much.

RegEx will be

(?:thankYou){2}

Output:
thankYouthankYou so much.
thankYou so much.

Explanation of RegEx:
(?: – Starting of non-capturing group
thankYou – Represents the actual word to match.
) – End of non-capturing group
{2} – Matches the previous pattern exactly 2 times.

We can set minimum and maximum limits also. We can write this regex pattern as

(?:thankYou){1,2}

Output of this pattern:
thankYouthankYou so much.
thankYou so much.

Here in {1,2}, 1 is represents minimum and 2 represents maximum occurrences of thankYou.