my $regex = '(?## 1 Something\,\text\text\0x2B X 99 #### 1 This is a problem->\,B 2 #### my $regex = '(?::,B,2'; my @test = split( /$regex/, "$text" ); foreach( @test ) { print "$_\n"; } #### 1 This:, is not a problem->:: B 2