$ perl -e '$s="foobaaarbaz"; print join " ", split /ba+r/, $s;' foo baz #### $ perl -e '$s="85|mat\@com";$sep=qr/\|/;($key,$email)=split($sep,$s); print "$key\t$email\n";' 85 mat@com #### DB<1> $s = "\|" DB<2> $t = qr/$s/ DB<3> p $t (?^:|) DB<4> $u = qr/\|/ DB<5> p $u (?^:\|)