CS2613/labs/L16/parse_csv.py

15 lines
282 B
Python

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