linfo2335-programming-parad.../project-3/regex/hardcodedlist.py

8 lines
178 B
Python

import re
def detect_hardcoded_list(code):
regex = r"\[([^,\]\[]+,){2,}([^,\]\[]+)\]"
result = re.search(regex, code)
if result:
return True
return False