in reply to Convert string to data structure
my $str = "1. ...... AB_CD 1.1 ...... EF_GH 1.2 .... IJ_KL_MN 2. ..... +....... OPQR"; my( undef, %chap ) = split /\s*(\d+\.\d*)\s*\.+\s*/, $str;
Works.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Convert string to data structure (split)
by Athanasius (Archbishop) on Sep 21, 2012 at 16:03 UTC | |
by tye (Sage) on Sep 21, 2012 at 16:06 UTC |