import re
def extract_substrings(text):
# Regular expression pattern to find substrings between single quotation marks
pattern = r"'(.*?)'"
# Find all matches in the input text
substrings = re.findall(pattern, text)
if not substrings:
return ""
return substrings
s = "Python is a 'high-level', 'general-purpose' 'type-checked' 'garbage-collected'"
result = extract_substrings(s)
print(result)
'''
run:
['high-level', 'general-purpose', 'type-checked', 'garbage-collected']
'''