PerlKc has asked for the wisdom of the Perl Monks concerning the following question:
Please help. My problem is I need to find the matched position. ExpectedOutcome is
Looking for pattern1 = C[AG]G Pattern C[AG]G matched CAG at reside 2 ans so on......
I have generated following code but couldn't come up with desired output. Please help
#!/usr/bin/perl use warnings; use strict; use diagnostics; my $Dna1 = "AACAGCACGGCAACGCTGTGCCTTGGGCACCATGCAGTACCAAACGGAACGATAGTGA +AAACAATCACGA\n"; while ($Dna1 =~ /C[AG]G/g){ my $endposition = pos($Dna1) + 1; my $matchlength = length($1); #I need to print Looking for pattern1 = C[AG]G Pattern C[AG]G matched CAG at residue 2 print .
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex matching and position
by graff (Chancellor) on Oct 21, 2015 at 01:42 UTC | |
|
Re: Regex matching and position
by AnomalousMonk (Archbishop) on Oct 21, 2015 at 02:09 UTC | |
by Anonymous Monk on Jun 08, 2019 at 18:52 UTC | |
by AnomalousMonk (Archbishop) on Jun 08, 2019 at 19:12 UTC | |
|
Re: Regex matching and position
by Anonymous Monk on Oct 20, 2015 at 23:50 UTC | |
by PerlKc (Novice) on Oct 21, 2015 at 00:06 UTC | |
by Anonymous Monk on Oct 21, 2015 at 01:02 UTC | |
by PerlKc (Novice) on Oct 27, 2015 at 22:39 UTC |