skip to content
Alvin Lucillo

Character repetitions

/ 1 min read

💻 Tech

Let’s say we need to find a Ouah expression with only 3 h’s at the end, we could use the regex expression: Ouahhh. Or simply: Ouah{3}

The curl braces indicate how many times the preceding character is repeated.

Example;

Ouahhhh - matched
Ouah - matched
Ouahh - matched

Ouah{3} states exactly 3 consecutive h. It can take a range like Ouah{1,3}, which indicates between 1 to 3 repetitions.