in reply to Simple line parse question
Don't know about speed, but my own preference would be for something along the lines of:
>perl -wMstrict -le "my $s = 'aa b: CCC DD. eee, ff ggg?'; my $word = qr{ [[:alpha:]]+ }xms; my @words = $s =~ m{ $word }xmsg; my $result = join q{}, @words[2,3]; print qq{'$result'}; " 'CCCDD'
This allows better definition and control of what a 'word' is.
Updates:
|
|---|