Skip to content

Commit 93fc313

Browse files
committed
Matches exactly the specified number of repetitions
1 parent 170dc69 commit 93fc313

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

0005-Regular-Expressions-Search/regex_search.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,14 @@
4646

4747
RESULT = re.search(r'ab*', 'b')
4848
print(bool(RESULT)) # Output: False
49+
50+
print('{} : Matches exactly the specified number of repetitions')
51+
52+
RESULT = re.search(r'a{3}', 'aaa')
53+
print(bool(RESULT)) # Output: True
54+
55+
RESULT = re.search(r'a{3}', 'aaaa')
56+
print(bool(RESULT)) # Output: True
57+
58+
RESULT = re.search(r'a{3}', 'aab')
59+
print(bool(RESULT)) # Output: False

0 commit comments

Comments
 (0)