in reply to Re: How do I match lines of UP TO 40 chars BUT NO MORE in a block of text?
in thread How do I match lines of UP TO 40 chars BUT NO MORE in a block of text?
$foo = "line1line1line1line1line1line1line1line1 line2line2line2line2line2line2line2line2line2line2line2line2line2line2 +line2line2line2line2 line3line3line3line3line3line3line3line3"; if ($foo =~ /((?:^.{0,40})\n{1,4})/m) { print "$1: OK\n\n"; } else {print "$1: NOT OK\n\n";}
Which is not good, since line2 is greater than 40 chars.
thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: How do I match lines of UP TO 40 chars BUT NO MORE in a block of text?
by sauoq (Abbot) on Sep 25, 2002 at 21:33 UTC | |
by Anonymous Monk on Sep 26, 2002 at 01:57 UTC | |
by sauoq (Abbot) on Sep 26, 2002 at 02:11 UTC | |
by kleinbiker7 (Sexton) on Sep 26, 2002 at 15:06 UTC |