in reply to Re: Extracting a substring according to some criteria
in thread Extracting a substring according to some criteria

Friends,

I have encountered one problem for the below input because the last character G of first line and the first character C of the next line are @allowed region. But when I get the output, G and C are not in allowed. This is because There is a space after the last character G.

my @allowed = qw[ AA AG GC GT CA CG TT TC ]; my $allowed = join "|", @allowed; my $regex = qr/ N+ | (?: (?=$allowed) . )* . /x; $data="TGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG +GGGGGGGGGGGGGGGGGGGGGATAG C"; print "$_\n" for $data =~ m/$regex/g;

ie instead to be printed as GC I get it as

G C
which is wrong Please give a solution.

Edit: g0n - code tags