Skip to content

Commit c0b1621

Browse files
committed
Adding 0004-regex-match.py
1 parent b55a59e commit c0b1621

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed
File renamed without changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# 0004-regex-match.py
2+
3+
import re
4+
5+
result = re.match(r'Hello', 'Hello World')
6+
print(bool(result)) # Output: True
7+
8+
# No Match if Not at the Beginning
9+
10+
result = re.match(r'World', 'Hello World')
11+
print(bool(result)) # Output: False
12+
13+
14+

0 commit comments

Comments
 (0)