Skip to content

Commit 442c2d2

Browse files
committed
Matches any digit (equivalent to [0-9])
1 parent 2c4b3e7 commit 442c2d2

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
@@ -73,3 +73,14 @@
7373

7474
RESULT = re.search(r'cat|dog|parrot', 'I have a zebra')
7575
print(bool(RESULT)) # Output: False
76+
77+
print('\d : Matches any digit (equivalent to [0-9])')
78+
79+
RESULT = re.search(r'\d', 'Hello 123')
80+
print(bool(RESULT)) # Output: True
81+
82+
RESULT = re.search(r'\d', 'Hello')
83+
print(bool(RESULT)) # Output: False
84+
85+
86+

0 commit comments

Comments
 (0)