in reply to split string on key word

#and the second part
print $&.$';

Replies are listed 'Best First'.
Re^2: split string on key word
by chrism01 (Friar) on Sep 23, 2005 at 06:06 UTC
    Quick 'n dirty:
    ($str1,$str2) = split(/Wnr:/, "some one 7/7 Wnr: some 2 2/3"); $str2 = "Wnr:".$str2; print "$str1\n$str2\n";
    some one 7/7
    Wnr: some 2 2/3