The flip-flop operator can help:
use strict; use warnings; while(<DATA>){ next if m|^/\*.*\*/|; print if /^OT;$/../^RT;$/; } __DATA__ OT; some line /*asas*/ ##here comments should be removed /*asdas*/ #OT;.....RT;should be replaced with OT;.....DT;OT.......RT; some line RT; some lines somlelines OT; some line /*asas*/ /*asdas*/ some line RT;
In reply to Re: Need regular expression
by hdb
in thread Need regular expression
by praveenchappa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |