Skip to content

Commit 370f700

Browse files
committed
Add regex
1 parent e239e92 commit 370f700

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Hacktober2023/regex.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import re
2+
3+
pattern = '^a...s$'
4+
test_string = 'abyssswsws'
5+
result = re.match(pattern, test_string)
6+
7+
if result:
8+
print("Search successful.")
9+
else:
10+
print("Search unsuccessful.")

0 commit comments

Comments
 (0)