in reply to Re^2: Truncating after the last period
in thread Truncating after the last period
Let's assume the text is in the ASCII character encoding and that there is at least one period among the first 400 characters in the text.... I demonstrated the defect to you in the complete, ready-to-run Perl script I posted.
Twaddle! This code doesn't have a period within the first 400 characters:
#!/usr/bin/perl use strict; use warnings; use open qw( :encoding(UTF-8) :std ); use Modern::Perl; my $string = ('X' x 400) . '.'; say length $string; # Prints 401 $string =~ s[^.{1,400}\.\K.*?$][]; say length $string; # Prints 401
The first 400 characters are all 'X's. Ergo, your code demonstrates exactly nothing!
And I can safely assume the fact that you have dropped your \X stuff like a hot brick means that you've finally realised that that is a dead end also.
So, I was right. Nothing more than PST.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Truncating after the last period
by Jim (Curate) on Aug 23, 2011 at 00:39 UTC | |
by BrowserUk (Patriarch) on Aug 23, 2011 at 00:52 UTC | |
by Jim (Curate) on Aug 23, 2011 at 01:47 UTC | |
by BrowserUk (Patriarch) on Aug 23, 2011 at 02:15 UTC |