in reply to Re: Re: How do I match lines of 40 characters long in a block of text?
in thread How do I match lines of 40 characters long in a block of text?
And: as soon as you ask for at least one line, without an "^" anchor, your first line might contain more than 40 characters, only the regex it will only grab the last 40 ones of that line!
In short: it is definitely not a bad idea to add an anchor.
or/^((?:.{0,40}\n){0,4})/;
The latter case can grab 1 to 4 whole lines anywhere in your text./^((?:.{0,40}\n){1,4})/m;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: How do I match lines of 40 characters long in a block of text?
by BrowserUk (Patriarch) on Sep 25, 2002 at 21:26 UTC |