in reply to Convert string to data structure

$s = "1. ...... AB_CD 1.1 ...... EF_GH 1.2 .... IJ_KL_MN 2. .......... +.. OPQR";; @a = map{ /(\S+)\s+\.+\s+(\S+)/; { chapter => $1, name => $2 } } split '(?<=[^.])\s(?=[^.])', $s;; pp \@a;; [ { chapter => "1.", name => "AB_CD" }, { chapter => "1.1", name => "EF_GH" }, { chapter => "1.2", name => "IJ_KL_MN" }, { chapter => "2.", name => "OPQR" }, ]

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong