Hello I have read into using regex but I cannot understand how to use it.
I would like to split a string to make a list, splitting by spaces except when enclosed by # # or quotes " "
values = '2 #room 2.# 5 1 -1 -1'
or values = '2 "room 2." 5 1 -1 -1'
just using split() results in:
['2', '#room', '2.#', '5', '1', '-1', '-1']
I would like it to output the name of the room without the # and without it split up because of the space:
['2', 'room 2.', '5', '1', '-1', '-1']