in reply to Re: Split string using regex on \n or max line length (updated x3)
in thread Split string using regex on \n or max line length
Update: The following modification to the regex eliminates the need for the s/\s+$// for @lines; above (works because \s includes newline):
I still plead for keeping the \W, best with non-greedifier i.e. \W?, so a final punctuation or hyphen is captured even though the limit is exceeded by one.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Split string using regex on \n or max line length
by haukex (Archbishop) on Feb 10, 2017 at 13:25 UTC | |
by flowdy (Scribe) on Feb 14, 2017 at 10:15 UTC |