string-parsing

Splitting on spaces, except between certain characters

Splitting on spaces, except between certain characters Question: I am parsing a file that has lines such as type(“book”) title(“golden apples”) pages(10-35 70 200-234) comments(“good read”) And I want to split this into separate fields. In my example, there are four fields: type, title, pages, and comments. The desired result after splitting is [‘type(“book”)’, ‘title(“golden …

Total answers: 5