CS2613/labs/L16/parse_csv.py

15 lines
282 B
Python
Raw Normal View History

2022-11-15 09:59:08 -04:00
import re
def split_csv(string):
return [row.split(",") for row in string.splitlines()]
def strip_quotes(string):
strip_regex = re.compile(r'("?)*$("?)')
search = strip_regex.search(string)
if search:
return search.group(1)
else:
return None