Re: substring first 100 words from a string in perl

2011-08-01 Thread Rob Dixon
On 01/08/2011 19:14, Dr.Ruud wrote: my ($rtioverview) = $string =~ /(.{0,100})\b/; That would have to be my ($rtioverview) = $string =~ /(.{0,99})\S\b/; to avoid terminating at the start of a non-space sequence. Rob -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional

Re: substring first 100 words from a string in perl

2011-08-01 Thread Dr.Ruud
On 2011-07-28 15:23, Khabza Mkhize wrote: I want to substring words, I might be using wrong terminology. But I tried the following example the only problem I have it cut word any where it likes. eg "breathtaking" on my string is only bre. $string = "This is an awe-inspiring tour to the

RE: substring first 100 words from a string in perl

2011-07-29 Thread Bob McConnell
My first impression was that he wanted the first hundred characters rounded off to the previous or next full word. It sounded like he wanted smart line breads at the word boundaries. Bob McConnell From: timothy adigun > I get the point you are making here, if you check the subroutine "sub > che

Re: substring first 100 words from a string in perl

2011-07-28 Thread timothy adigun
Hi Rob, I get the point you are making here, if you check the subroutine "sub checkStr{}" you see dat it confirm what you are pointing out. However, I think the point there is the number of words the programmers wants! [Khabza, correct me if am wrong]. Since, split function as indicated will remov

Re: substring first 100 words from a string in perl

2011-07-28 Thread Rob Dixon
On 28/07/2011 14:23, Khabza Mkhize wrote: I want to substring words, I might be using wrong terminology. But I tried the following example the only problem I have it cut word any where it likes. eg "breathtaking" on my string is only bre. $string = "This is an awe-inspiring tour to the

Re: substring first 100 words from a string in perl

2011-07-28 Thread timothy adigun
Hello Khabza, " I want to substring words, I might be using wrong terminology. But I tried the following example the only problem I have it cut word any where it likes. eg "breathtaking" on my string is only bre." -- If you count your $string alphabeth by alphabeth from 0 to 100 including eve

Re: substring first 100 words from a string in perl

2011-07-28 Thread timothy adigun
Hi Rob Coops, " I want to substring words, I might be using wrong terminology. But I tried the following example the only problem I have it cut word any where it likes. eg "breathtaking" on my string is only bre." -- If you count your $string alphabeth by alphabeth from 0 to 100 including ev

Re: substring first 100 words from a string in perl

2011-07-28 Thread Rob Coops
On Thu, Jul 28, 2011 at 3:23 PM, Khabza Mkhize wrote: > I want to substring words, I might be using wrong terminology. But I tried > the following example the only problem I have it cut word any where it > likes. eg "breathtaking" on my string is only bre. > > > $string = "This is an awe-in