Just try this below code
#! /usr/bin/perl use strict; use warnings; while (<DATA>) { chomp; if(/^TAG\d{1}.*TAG\d{1}.*/) { print ">>>$_<<\n"; } } __DATA__ TAG1 text one TAG2 etc TAG1 text two TAG2 etc TAG1 text three TAG2 etc TAGS text four TAG2 etc TAG1 text five TAGT etc TAGZ text four TAGX etc
In reply to Re: negative look behind (again)
by leslie
in thread negative look behind (again)
by cmic
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |