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
That is because \b{wb} matches between those signs.
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 (Sage) on Feb 25, 2022 at 10:22 UTC | |
by salva (Canon) on Feb 25, 2022 at 11:00 UTC | |
by LanX (Sage) 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 (Friar) on Feb 26, 2022 at 21:00 UTC |
In Section
Seekers of Perl Wisdom