in reply to Regex needed :<

#!/usr/bin/env perl use strict; use warnings; my $flag; while (<DATA>) { if (/\/\*/) { $flag=!$flag; #turns on and off next; } if ( ($flag) && /\/{2,2}(.*)/) { print "$1\n"; } } __DATA__ // useless comment Some Code //********************************************************** // //I need that text // And that also // //********************************************************** Some Code // useless comment