my $regex = '(?::,B,2'; my @test = split( /$regex/, "$text" ); foreach( @test ) { print "$_\n"; }