Hi, > It works fine and I like it. My regex is not that good, but I can see what > is doing. I modified it a bit (to capture up till a full stop sign).
Kewl. Good to hear that! Regards, Akhthar Parvez K http://Tips.SysAdminGUIDE.COM UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity - Dennie Richie On Sunday 18 Apr 2010, Mimi Cafe wrote: > Hi, > > > <Code> > #!/usr/bin/perl > # > use strict; > use warnings; > # > my $str = "The black cat is trying to climbed the green tree. This time it > failed."; print "string: $str\n"; > my $sbstr = substr $str, 0,17; > print "The substr function with length 17 will capture: $sbstr\n"; > $str =~ m{ \A ( .{17} .*?\. ) \s }msx; > my $extracted = $1; > print "The pattern with quantifier set 17, extracted: $extracted\n"; <Code> > <Code> > > > Outputs: > > string: The black cat is trying to climbed the green tree. This time it > failed. > The substr function with length 17 will capture: The black cat is > The pattern with quantifier set 17, extracted: The black cat is trying to > climbed the green tree. > > > Cool > > > > > -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/