Assuming it should have stayed, there's a not-only-regex solution:
#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; my @expected = ('AT___CGGA___TCTGGC', 'A-C___-G--CTG___GC'); # ^ my $tag = '___'; for ('ATCGGATCTGGC', 'A-C-G--CTGGC', ) { my $seq = $_; my $pos = 0; my $count_letters = 0; for my $stop (2, 6) { until ($count_letters == $stop) { $seq =~ /([ATGC])/g; $pos = pos $seq; $count_letters++; } substr $seq, $pos, 0, $tag; pos $seq = $pos + length $tag; } my $exp = shift @expected; say "$seq\t$exp\t", $exp eq $seq; }
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
In reply to Re: Regex to match range of characters broken by dashes
by choroba
in thread Regex to match range of characters broken by dashes
by Q.and
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |