#!/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
In reply to Re: Regex needed :<
by trippledubs
in thread Regex needed :<
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |