Possible Duplicate:
Split line with perl
I have a line:
regizor: Betty Thomas Distribuţia: Sandra Bullock (Gwen Cummings) Viggo Mortensen (Eddie Boone) Dominic West (Jasper) rendező: David Mamet, Robert Elswit szereplő(k): Chiwetel Ejiofor (Mike Terry) Alice Braga (Sondra Terry) Emily Mortimer (Laura Black)
I want to split with perl in:
regizor: Betty Thomas
Distribuţia: Sandra Bullock (Gwen Cummings) Viggo Mortensen (Eddie Boone) Dominic West (Jasper)
rendező: David Mamet Robert Elswit
szereplő(k): Chiwetel Ejiofor (Mike Terry) Alice Braga (Sondra Terry) Emily Mortimer (Laura Black)
How about:
This will split the string before every occurrence of a “word” (a sequence of non-space characters) followed by a colon and a space (and without producing an empty field at the beginning).