BhariD has asked for the wisdom of the Perl Monks concerning the following question:
ACGTTGGCTATTGGGCCCGCT
I am searching for the pattern 'GTT' in the above string. As you will notice, pattern 'GTT' occurs in the start of the string. Once the pattern is matched, I need to remove any number of characters before (here, AC) and 3 characters (GGC) after the pattern ('GTT').
so the output will look something like this:
TATTGGGCCCGCT
Any pointers how I can do this? Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to remove characters before and after a search pattern in a string?
by ikegami (Patriarch) on Mar 03, 2010 at 17:25 UTC | |
by jrsimmon (Hermit) on Mar 03, 2010 at 18:15 UTC | |
by ikegami (Patriarch) on Mar 03, 2010 at 18:23 UTC | |
|
Re: how to remove characters before and after a search pattern in a string?
by thunders (Priest) on Mar 03, 2010 at 18:49 UTC | |
by jwkrahn (Abbot) on Mar 03, 2010 at 19:58 UTC |