I have a field that can filter over some db columns. But I'm having trouble splitting the search string as I need:
I have this example:
import re
search = ' test "no splits234" this-splits this_not_splits asdf123 '
re.split(r'[\s]*[\W][\s]*', search.strip())
['test', 'no', 'splits234', 'this', 'splits', 'this_not_splits', 'asdf123']
Need this output:
['test', 'no splits234', 'this', 'splits', 'this_not_splits', 'asdf', '123']
Do not splits what is in quotes and splits text from numbers. How can I do this?
str. It overrides a builtin name