in reply to Is this the best regex?
The regex /^\s\s\s\s\S.*:$/ captures this delimiter, but I cannot use the regex in split(/^\s\s\s\s\S.*:$/,$apps_rep);
Try split(/^\s\s\s\s\S.*:$/m,$apps_rep); (note the /m — it makes ^ and $ match the start/end of lines within the string)
You probably also want to put capturing parentheses in the pattern — /^\s\s\s\s(\S.*):$/m — in order to keep what was split on, i.e. you'd then get alternating entries for record title (app name) and record body.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is this the best regex?
by ikegami (Patriarch) on Sep 09, 2009 at 00:32 UTC | |
|
Re^2: Is this the best regex?
by Anonymous Monk on Sep 09, 2009 at 04:54 UTC | |
by Anonymous Monk on Sep 09, 2009 at 04:59 UTC | |
by Anonymous Monk on Sep 09, 2009 at 05:03 UTC |