Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This works well, but I would also like to split if \n exists in the string. Basically, I want to split on \n and still provide a maximum length per string in the array. What is the simplest way to do this?@invoice_note_lines = $invoice_data_ref->{'invoice_note'} =~ /(.{1,$in +voice_note_line_length}\W)/gms;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Split string using regex on \n or max line length (updated x3)
by haukex (Archbishop) on Feb 10, 2017 at 08:04 UTC | |
by flowdy (Scribe) on Feb 10, 2017 at 09:11 UTC | |
by haukex (Archbishop) on Feb 10, 2017 at 13:25 UTC | |
by flowdy (Scribe) on Feb 14, 2017 at 10:15 UTC | |
by choroba (Cardinal) on Feb 10, 2017 at 15:30 UTC | |
by Anonymous Monk on Feb 14, 2017 at 05:03 UTC | |
|
Re: Split string using regex on \n or max line length
by flowdy (Scribe) on Feb 10, 2017 at 08:08 UTC |