import re
# Declare the regex pattern
pattern = re.compile(r"htt+p")
# Test strings
test_strings = ["http", "htttp", "httttp", "httpp", "htp"]
# Check matches
for test in test_strings:
match = bool(pattern.fullmatch(test)) # Use fullmatch for exact matches
print(f'Matches "{test}": {match}')
# Matches "httpp": True or false, depending on how matches() method works
'''
run:
Matches "http": True
Matches "htttp": True
Matches "httttp": True
Matches "httpp": False
Matches "htp": False
'''