in reply to Re^2: Splitting multiline string into words, the stuff between words, and newlines
in thread Splitting multiline string into words, the stuff between words, and newlines
This seems to solve the issue:
my @fragments = grep length, split /(\b{wb}\w.*?\b{wb}|\n+)/, $book;
But my knowledge of Unicode and the \b{wb} semantics is rather limited so that may have other issues.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Splitting multiline string into words, the stuff between words, and newlines
by LanX (Saint) on Feb 25, 2022 at 10:22 UTC | |
by salva (Canon) on Feb 25, 2022 at 11:00 UTC | |
by LanX (Saint) on Feb 25, 2022 at 11:11 UTC | |
by salva (Canon) on Feb 25, 2022 at 11:19 UTC | |
|
Re^4: Splitting multiline string into words, the stuff between words, and newlines
by ibm1620 (Hermit) on Feb 26, 2022 at 21:00 UTC |