Benson has asked for the wisdom of the Perl Monks concerning the following question:
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 in the input there is a space after the last character G and the character C is in the next line.
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.
2005-10-21 Retitled by planetscape, as per Monastery guidelines
Original title: 'Reading Substring'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to remove Newline
by Skeeve (Parson) on Oct 20, 2005 at 07:37 UTC | |
|
Re: How to remove Newline
by blazar (Canon) on Oct 20, 2005 at 09:03 UTC | |
|
Re: How to remove Newline
by GrandFather (Saint) on Oct 20, 2005 at 08:56 UTC |