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 “……….”
In reply to Regex matching and position by PerlKc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |