I would like to parse text and separate it into tasks and subtasks:
'Asubsubsubtask:Bsubtask:Ctask:D'.split(/((sub)*task)\:/i)
#=> ["A", "subsubsubtask", "sub", "B", "subtask", "sub", "C", "task", "D"]
The last part of the result array is not consistent and doesn't allow me to use #each_slice(3) processing the array.
What would you suggest me to use instead of matching each element of the array with a similar regex?
EDIT1:
More detailed example:
Task: Main
description
Defaults: some params
Subtask: Basic
description
Options: A B C
Subsubtask: Reading
description
Parameters: some params
and I try to split it by /^((sub)*task)\:/i