xxxxxxxxxx
import re
pattern = r'^(?!abc).*'
# Test the pattern
strings = ["abc123", "abcd", "123abc", "def", "123"]
for string in strings:
if re.match(pattern, string):
print(f"Matched: {string}")
else:
print(f"Not matched: {string}")